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
Washington Luiz b4973315e9 Merge branch 'master' into bring-rails-3
Conflicts:
	.travis.yml
	Gemfile
	README.md
	lib/ransack/adapters/active_record/3.0/context.rb
	lib/ransack/adapters/active_record/3.1/context.rb
	lib/ransack/adapters/active_record/3.2/context.rb
	lib/ransack/adapters/active_record/base.rb
	lib/ransack/adapters/active_record/context.rb
	lib/ransack/constants.rb
	lib/ransack/context.rb
	lib/ransack/helpers/form_builder.rb
	lib/ransack/helpers/form_helper.rb
	lib/ransack/nodes/attribute.rb
	lib/ransack/nodes/condition.rb
	lib/ransack/nodes/grouping.rb
	lib/ransack/nodes/sort.rb
	lib/ransack/predicate.rb
	lib/ransack/translate.rb
	ransack.gemspec
	spec/blueprints/people.rb
	spec/ransack/adapters/active_record/base_spec.rb
	spec/ransack/adapters/active_record/context_spec.rb
	spec/ransack/configuration_spec.rb
	spec/ransack/dependencies_spec.rb
	spec/ransack/helpers/form_builder_spec.rb
	spec/ransack/helpers/form_helper_spec.rb
	spec/ransack/predicate_spec.rb
	spec/ransack/search_spec.rb
	spec/ransack/translate_spec.rb
	spec/support/schema.rb
2014-04-10 00:28:29 -03:00

28 lines
682 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