activerecord-hackery--ransack/lib/ransack.rb

29 lines
682 B
Ruby
Raw Normal View History

require 'active_support/core_ext'
2011-03-31 00:31:39 +00:00
require 'ransack/configuration'
module Ransack
extend Configuration
class UntraversableAssociationError < StandardError; end;
2011-03-31 00:31:39 +00:00
end
Ransack.configure do |config|
Ransack::Constants::AREL_PREDICATES.each do |name|
2013-08-12 08:27:50 +00:00
config.add_predicate name, arel_predicate: name
2011-03-31 00:31:39 +00:00
end
Ransack::Constants::DERIVED_PREDICATES.each do |args|
config.add_predicate *args
end
end
require 'ransack/translate'
require 'ransack/search'
require 'ransack/ransacker'
require 'ransack/adapters/active_record' if defined?(::ActiveRecord::Base)
2011-03-31 00:31:39 +00:00
require 'ransack/helpers'
require 'action_controller'
ActionController::Base.helper Ransack::Helpers::FormHelper