Module: Mongoid::Lookup::ClassMethods
- Defined in:
- lib/mongoid_lookup.rb
Instance Method Summary collapse
-
#has_lookup(name, options, &block) ⇒ Object
Configures lookup on calling model.
-
#lookup_collection ⇒ Object
Configures calling model as a lookup collection.
Instance Method Details
#has_lookup(name, options, &block) ⇒ Object
Configures lookup on calling model. accepts a block which will be evaluated in the class of the generated lookup reference model
21 22 23 24 |
# File 'lib/mongoid_lookup.rb', line 21 def has_lookup name, , █ include Model unless included_modules.include?(Model) build_lookup(name, , &block) end |
#lookup_collection ⇒ Object
Configures calling model as a lookup collection
13 14 15 16 |
# File 'lib/mongoid_lookup.rb', line 13 def lookup_collection include Collection build_lookup_collection end |