Module: Ripple::Associations::ClassMethods

Defined in:
ripple/lib/ripple/associations.rb

Instance Method Summary (collapse)

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 embedded_associations
  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, options={})
  create_association(:many, name, options)
end

- (Object) one(name, options = {})

Creates a singular association



84
85
86
# File 'ripple/lib/ripple/associations.rb', line 84

def one(name, options={})
  create_association(:one, name, options)
end