Module: Mongoid::Lookup::Reference::ClassMethods
- Defined in:
- lib/mongoid_lookup/reference.rb
Instance Method Summary collapse
- #configure_lookup_reference(options) ⇒ Object
-
#lookup_field_map ⇒ Hash
Map of source fields to reference fields.
-
#resolve_lookup_field_map(options) ⇒ Object
inherit field map and merge new fields.
Instance Method Details
#configure_lookup_reference(options) ⇒ Object
12 13 14 |
# File 'lib/mongoid_lookup/reference.rb', line 12 def configure_lookup_reference resolve_lookup_field_map() end |
#lookup_field_map ⇒ Hash
Returns map of source fields to reference fields.
25 26 27 |
# File 'lib/mongoid_lookup/reference.rb', line 25 def lookup_field_map instance_variable_get(:@field_map) end |
#resolve_lookup_field_map(options) ⇒ Object
inherit field map and merge new fields
19 20 21 22 |
# File 'lib/mongoid_lookup/reference.rb', line 19 def resolve_lookup_field_map map = (superclass.instance_variable_get(:@field_map) or {}).dup.merge(([:map] or {})) instance_variable_set(:@field_map, map) end |