diff --git a/CHANGELOG b/CHANGELOG index e69de29..90e40f3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -0,0 +1 @@ +* Make #event! methods return a boolean [Joel Chippindale] diff --git a/lib/aasm.rb b/lib/aasm.rb index 5ecce87..b64e80b 100644 --- a/lib/aasm.rb +++ b/lib/aasm.rb @@ -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