Module: Subledger::Domain::Roles::Updatable

Included in:
Account, ActiveLine, ArchivedLine, Book, Category, Identity, JournalEntry, Org, Subledger::Domain::Report
Defined in:
lib/subledger/domain/roles/updatable.rb

Defined Under Namespace

Modules: UpdatableClass

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/subledger/domain/roles/updatable.rb', line 5

def self.included base
  base.extend UpdatableClass
end

Instance Method Details

#updateObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/subledger/domain/roles/updatable.rb', line 19

def update
  updatable = dup

  updatable.send :increment_version

  args = updatable.attributes

  updated = self.class.update args

  initialize updated.attributes

  self
end