Module: Mongoid::Relations::Reflections::ClassMethods
- Defined in:
- lib/mongoid/relations/reflections.rb
Instance Method Summary collapse
-
#reflect_on_all_associations(*macros) ⇒ Array<Metadata>
Returns all relation metadata for the supplied macros.
-
#reflect_on_association(name) ⇒ Metadata
Returns the relation metadata for the supplied name.
Instance Method Details
#reflect_on_all_associations(*macros) ⇒ Array<Metadata>
Returns all relation metadata for the supplied macros.
56 57 58 59 60 |
# File 'lib/mongoid/relations/reflections.rb', line 56 def reflect_on_all_associations(*macros) association_reflections = relations.values association_reflections.select! { |reflection| macros.include?(reflection.macro) } unless macros.empty? association_reflections end |
#reflect_on_association(name) ⇒ Metadata
Returns the relation metadata for the supplied name.
44 45 46 |
# File 'lib/mongoid/relations/reflections.rb', line 44 def reflect_on_association(name) relations[name.to_s] end |