Merge pull request #82 from Intrepidd/master
Allow overwriting of events, can be very useful with inheritance
This commit is contained in:
commit
c7a6e965e1
|
@ -48,9 +48,7 @@ module AASM
|
||||||
def event(name, options={}, &block)
|
def event(name, options={}, &block)
|
||||||
# @clazz.aasm_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)
|
||||||
@state_machine.events[name] = AASM::Event.new(name, options, &block)
|
|
||||||
end
|
|
||||||
|
|
||||||
# an addition over standard aasm so that, before firing an event, you can ask
|
# 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
|
# may_event? and get back a boolean that tells you whether the guard method
|
||||||
|
|
Loading…
Reference in New Issue