Module: Persistence::Save

Included in:
Persistence
Defined in:
lib/persistence/save.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) save(object)

Persists given object into database.



11
12
13
14
15
16
17
# File 'lib/persistence/save.rb', line 11

def save(object)
  if self.was_persisted?(object)
    self.persist_existing(object)
  else
    self.persist_new(object)
  end
end