Module: Rea::MetaType::Commitment

Defined in:
lib/rea/meta_type/commitment.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/rea/meta_type/commitment.rb', line 4

def self.included base
  base.fields = [:amount]
  Entity.included base
  base.extend ::Rea::MetaType::Event::ClassMethods
  base.extend ClassMethods
  base.after_save :after_save_commitment
end

Instance Method Details

#after_save_commitmentObject



12
13
14
15
16
# File 'lib/rea/meta_type/commitment.rb', line 12

def after_save_commitment
  if fulfilled_changed?
    self.class.event_creator.create_event(self)
  end
end