Allow overwriting of events, can be very useful with inheritance

This commit is contained in:
Adrien Siami 2013-08-07 17:35:31 +02:00
parent e6229e35e5
commit 32c1c962db
1 changed files with 1 additions and 3 deletions

View File

@ -48,9 +48,7 @@ module AASM
def event(name, options={}, &block)
# @clazz.aasm_event(name, options, &block)
unless @state_machine.events.has_key?(name)
@state_machine.events[name] = AASM::Event.new(name, options, &block)
end
@state_machine.events[name] = AASM::Event.new(name, options, &block)
# an addition over standard aasm so that, before firing an event, you can ask
# may_event? and get back a boolean that tells you whether the guard method