lib/ransack_ext.rb in activeadmin-1.0.0.pre2 vs lib/ransack_ext.rb in activeadmin-1.0.0.pre3
- old
+ new
@@ -7,6 +7,14 @@
end
{'equals'=>'eq', 'greater_than'=>'gt', 'less_than'=>'lt'}.each do |old,current|
config.add_predicate old, arel_predicate: current
end
+
+ config.add_predicate 'gteq_date',
+ arel_predicate: 'gteq',
+ formatter: ->(v) { v.beginning_of_day }
+
+ config.add_predicate 'lteq_date',
+ arel_predicate: 'lt',
+ formatter: ->(v) { v + 1.day }
end