2013-12-15 13:41:13 -05:00
|
|
|
require 'active_support/core_ext'
|
2011-03-30 20:31:39 -04:00
|
|
|
require 'ransack/configuration'
|
2015-05-22 11:00:03 -04:00
|
|
|
require 'ransack/adapters'
|
2019-02-10 06:42:09 -05:00
|
|
|
require 'polyamorous'
|
2016-04-04 05:29:49 -04:00
|
|
|
|
2016-04-05 05:09:21 -04:00
|
|
|
Ransack::Adapters.object_mapper.require_constants
|
2014-08-02 18:16:16 -04:00
|
|
|
|
2011-03-30 20:31:39 -04:00
|
|
|
module Ransack
|
|
|
|
extend Configuration
|
2011-05-30 13:00:59 -04:00
|
|
|
class UntraversableAssociationError < StandardError; end;
|
2011-03-30 20:31:39 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Ransack.configure do |config|
|
|
|
|
Ransack::Constants::AREL_PREDICATES.each do |name|
|
2014-05-01 09:55:39 -04:00
|
|
|
config.add_predicate name, :arel_predicate => name
|
2011-03-30 20:31:39 -04:00
|
|
|
end
|
2014-08-02 18:16:16 -04:00
|
|
|
Ransack::Constants::DERIVED_PREDICATES.each do |args|
|
2018-02-02 04:49:41 -05:00
|
|
|
config.add_predicate(*args)
|
2011-03-30 20:31:39 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'ransack/search'
|
2011-04-11 20:07:23 -04:00
|
|
|
require 'ransack/ransacker'
|
2015-04-08 13:25:44 -04:00
|
|
|
require 'ransack/translate'
|
|
|
|
|
2016-04-05 05:09:21 -04:00
|
|
|
Ransack::Adapters.object_mapper.require_adapter
|
2015-04-08 13:25:44 -04:00
|
|
|
|
2017-11-02 17:11:39 -04:00
|
|
|
ActiveSupport.on_load(:action_controller) do
|
2019-10-16 07:05:48 -04:00
|
|
|
require 'ransack/helpers'
|
2017-11-02 17:11:39 -04:00
|
|
|
ActionController::Base.helper Ransack::Helpers::FormHelper
|
|
|
|
end
|