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
Jon Atack 1abf8f6086 Maintain Ruby 1.8.7 syntax compatibility
since Rails 3.x stills supports Ruby 1.8.7 as per
http://guides.rubyonrails.org/v3.2.17/getting_started.html:
“Ruby language version 1.8.7 or higher.”
2014-05-01 15:55:39 +02:00

28 lines
685 B
Ruby

require 'active_support/core_ext'
require 'ransack/configuration'
module Ransack
extend Configuration
class UntraversableAssociationError < StandardError; end;
end
Ransack.configure do |config|
Ransack::Constants::AREL_PREDICATES.each do |name|
config.add_predicate name, :arel_predicate => name
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)
require 'ransack/helpers'
require 'action_controller'
ActionController::Base.helper Ransack::Helpers::FormHelper