Module: Mongoid::Lookup::Collection::ClassMethods

Defined in:
lib/mongoid_lookup/collection.rb

Instance Method Summary collapse

Instance Method Details

#build_lookup_collectionObject

configure the lookup collection



11
12
13
# File 'lib/mongoid_lookup/collection.rb', line 11

def build_lookup_collection
  relate_lookup_collection
end

#relate_lookup_collectionObject

add polymorphic relation to referenced document



18
19
20
# File 'lib/mongoid_lookup/collection.rb', line 18

def relate_lookup_collection
  belongs_to :referenced, :polymorphic => true
end