Module: Ripple::Associations::ClassMethods
- Defined in:
- ripple/lib/ripple/associations.rb
Instance Method Summary (collapse)
-
- (Object) associations
Associations defined on the document.
-
- (Object) embedded_associations
Associations of embedded documents.
-
- (Object) many(name, options = {})
Creates a plural association.
-
- (Object) one(name, options = {})
Creates a singular association.
Instance Method Details
- (Object) associations
Associations defined on the document
74 75 76 |
# File 'ripple/lib/ripple/associations.rb', line 74 def associations @associations ||= {}.with_indifferent_access end |
- (Object) embedded_associations
Associations of embedded documents
79 80 81 |
# File 'ripple/lib/ripple/associations.rb', line 79 def associations.values.select(&:embeddable?) end |
- (Object) many(name, options = {})
Creates a plural association
89 90 91 |
# File 'ripple/lib/ripple/associations.rb', line 89 def many(name, ={}) create_association(:many, name, ) end |
- (Object) one(name, options = {})
Creates a singular association
84 85 86 |
# File 'ripple/lib/ripple/associations.rb', line 84 def one(name, ={}) create_association(:one, name, ) end |