Sha256: 76aa4ff84c079ccf25cb6f7bbecaa488d54f5d31fe79f28a3f5b080bc99ac478
Contents?: true
Size: 727 Bytes
Versions: 9
Compression:
Stored size: 727 Bytes
Contents
# 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] 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_datetime', arel_predicate: 'gteq', formatter: ->(v) { v.beginning_of_day } config.add_predicate 'lteq_datetime', arel_predicate: 'lt', formatter: ->(v) { v + 1.day } end
Version data entries
9 entries across 9 versions & 1 rubygems