Module: Ransack::Adapters

Defined in:
lib/ransack/adapters.rb,
lib/ransack/adapters/mongoid/base.rb,
lib/ransack/adapters/mongoid/table.rb,
lib/ransack/adapters/mongoid/context.rb,
lib/ransack/adapters/active_record/base.rb,
lib/ransack/adapters/mongoid/inquiry_hash.rb,
lib/ransack/adapters/active_record/context.rb,
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/mongoid/attributes/attribute.rb,
lib/ransack/adapters/mongoid/attributes/predications.rb,
lib/ransack/adapters/mongoid/attributes/order_predications.rb

Defined Under Namespace

Modules: ActiveRecord, Mongoid Classes: ActiveRecordAdapter, MongoidAdapter

Class Method Summary collapse

Class Method Details

.instantiate_object_mapperObject


8
9
10
11
12
13
14
# File 'lib/ransack/adapters.rb', line 8

def self.instantiate_object_mapper
  if defined?(::ActiveRecord::Base)
    ActiveRecordAdapter.new
  elsif defined?(::Mongoid)
    MongoidAdapter.new
  end
end

.object_mapperObject


4
5
6
# File 'lib/ransack/adapters.rb', line 4

def self.object_mapper
  @object_mapper ||= instantiate_object_mapper
end