lib/aasm/base.rb in aasm-3.0.20 vs lib/aasm/base.rb in aasm-3.0.21
- old
+ new
@@ -46,12 +46,10 @@
# define an event
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
# on the transition will let this happen.
@clazz.send(:define_method, "may_#{name.to_s}?") do |*args|