lib/ransack_ext.rb in activeadmin-1.4.3 vs lib/ransack_ext.rb in activeadmin-2.0.0.rc1
- old
+ new
@@ -1,13 +1,13 @@
# This sets up aliases for old Metasearch query methods so they behave
# identically to the versions given in Ransack.
#
Ransack.configure do |config|
- {'contains'=>'cont', 'starts_with'=>'start', 'ends_with'=>'end'}.each do |old, current|
- config.add_predicate old, Ransack::Constants::DERIVED_PREDICATES.detect{ |q, _| q == current }[1]
+ { 'contains'=>'cont', 'starts_with'=>'start', 'ends_with'=>'end' }.each do |old, current|
+ config.add_predicate old, Ransack::Constants::DERIVED_PREDICATES.detect { |q, _| q == current }[1]
end
- {'equals'=>'eq', 'greater_than'=>'gt', 'less_than'=>'lt'}.each do |old, current|
+ { 'equals'=>'eq', 'greater_than'=>'gt', 'less_than'=>'lt' }.each do |old, current|
config.add_predicate old, arel_predicate: current
end
config.add_predicate 'gteq_datetime',
arel_predicate: 'gteq',