aboutsummaryrefslogtreecommitdiffstats
path: root/config/initializers/ransack.rb
blob: 659ee4a79c4d063d143288a555bf5fef0b742922 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
Ransack.configure do |config|
  config.add_predicate 'between',
                       arel_predicate: 'between',
                       formatter: proc { |v| v.split(' to ') },
                       type: :string
end
module Arel
  module Predications
    def between other
      gteq(other[0]).and(lt(other[1]))
    end
  end
end