1
0
Fork 0
mirror of https://github.com/activerecord-hackery/ransack.git synced 2022-11-09 13:47:45 -05:00
activerecord-hackery--ransack/lib/ransack.rb

36 lines
841 B
Ruby
Raw Normal View History

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
Ransack::Adapters.object_mapper.require_constants
2011-03-30 20:31:39 -04:00
module Ransack
extend Configuration
class UntraversableAssociationError < StandardError; end;
2011-03-30 20:31:39 -04:00
end
Ransack.configure do |config|
Ransack::Constants::AREL_PREDICATES.each do |name|
config.add_predicate name, :arel_predicate => name
2011-03-30 20:31:39 -04:00
end
Ransack::Constants::DERIVED_PREDICATES.each do |args|
config.add_predicate(*args)
2011-03-30 20:31:39 -04:00
end
end
require 'ransack/search'
require 'ransack/ransacker'
if defined?(ActionPack)
require 'ransack/helpers'
require 'action_controller'
end
require 'ransack/translate'
Ransack::Adapters.object_mapper.require_adapter
ActiveSupport.on_load(:action_controller) do
ActionController::Base.helper Ransack::Helpers::FormHelper
end