Module: Stall::Ransack

Defined in:
lib/ext/ransack.rb

Class Method Summary collapse

Class Method Details

.configureObject



3
4
5
6
7
8
9
10
11
# File 'lib/ext/ransack.rb', line 3

def self.configure
  ::Ransack.configure do |config|
    config.add_predicate 'between_cents',
      arel_predicate: 'between',
      formatter: proc { |v| Range.new(*v.split(',').map { |s| (s.to_i * 100) }) },
      validator: proc { |v| v.present? },
      type: :string
  end
end