1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Make #event! methods return a boolean [Joel Chippindale]

This commit is contained in:
Scott Barron 2008-02-21 12:11:25 -05:00
parent 073bcbf695
commit a68200556e
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1 @@
* Make #event! methods return a boolean [Joel Chippindale]

View file

@ -31,8 +31,12 @@ module AASM
define_method("#{name.to_s}!") do
new_state = self.class.aasm_events[name].fire(self)
self.aasm_current_state = new_state unless new_state.nil?
nil
unless new_state.nil?
self.aasm_current_state = new_state
true
else
false
end
end
end