| Module | Opensteam::StateMachine::ClassMethods |
| In: |
lib/opensteam/state_machine.rb
|
# File lib/opensteam/state_machine.rb, line 40
40: def initial_state( state )
41: after_create { |record| record.state = state }
42: end
notify association on state-change calls the observers of the association
# File lib/opensteam/state_machine.rb, line 51
51: def notify(assoc)
52: observers << Opensteam::StateMachine::Observer.new( self ) do |record|
53: record.send( assoc ).class.observers.each { |o| o.exc( record.send( assoc ) ) }
54: end
55: end