Module: MongoMapper::EmbeddedDocument::InstanceMethods

Defined in:
lib/mongo_mapper/embedded_document.rb

Instance Method Summary collapse

Instance Method Details

#_parent_document=(value) ⇒ Object



55
56
57
58
# File 'lib/mongo_mapper/embedded_document.rb', line 55

def _parent_document=(value)
  @_root_document   = value._root_document
  @_parent_document = value
end

#save(options = {}) ⇒ Object



41
42
43
44
45
46
# File 'lib/mongo_mapper/embedded_document.rb', line 41

def save(options={})
  if result = _root_document.try(:save, options)
    @new = false
  end
  result
end

#save!(options = {}) ⇒ Object



48
49
50
51
52
53
# File 'lib/mongo_mapper/embedded_document.rb', line 48

def save!(options={})
  if result = _root_document.try(:save!, options)
    @new = false
  end
  result
end