We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dffa889 commit 89ee521Copy full SHA for 89ee521
lib/ajax-datatables-rails/base.rb
@@ -16,7 +16,9 @@ def filter_relation(relation)
16
qry = []
17
filter.each do | k, v |
18
if k.end_with?("_at") and v.size == 2
19
- qry << "( #{k} >= '#{v[0].to_time.beginning_of_day}' AND #{k} <= '#{v[1].to_time.end_of_day}' )"
+ start_at = v[0].to_time
20
+ end_at = v[1].to_time
21
+ qry << "( #{k} >= '#{start_at.beginning_of_day}' AND #{k} <= '#{end_at.end_of_day}' )" if start_at.present? and end_at.present?
22
else
23
qry << "(" + v.map{|n|
24
0 commit comments