module Ransack::Configuration
def add_predicate(name, opts = {})
def add_predicate(name, opts = {}) name = name.to_s opts[:name] = name compounds = opts.delete(:compounds) compounds = true if compounds.nil? compounds = false if opts[:wants_array] self.predicates[name] = Predicate.new(opts) Constants::SUFFIXES.each do |suffix| compound_name = name + suffix self.predicates[compound_name] = Predicate.new( opts.merge( name: compound_name, arel_predicate: arel_predicate_with_suffix( opts[:arel_predicate], suffix ), compound: true ) ) end if compounds end