2013-12-15 13:41:13 -05:00
|
|
|
require 'active_support/core_ext'
|
|
|
|
|
2011-03-30 20:31:39 -04:00
|
|
|
require 'ransack/configuration'
|
|
|
|
|
|
|
|
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|
|
2013-08-12 04:27:50 -04:00
|
|
|
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
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'ransack/translate'
|
|
|
|
require 'ransack/search'
|
2011-04-11 20:07:23 -04:00
|
|
|
require 'ransack/ransacker'
|
2013-10-29 17:46:43 -04:00
|
|
|
require 'ransack/adapters/active_record' if defined?(::ActiveRecord::Base)
|
2011-03-30 20:31:39 -04:00
|
|
|
require 'ransack/helpers'
|
|
|
|
require 'action_controller'
|
|
|
|
|
2013-12-10 09:00:44 -05:00
|
|
|
ActionController::Base.helper Ransack::Helpers::FormHelper
|