aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/state_machine/event.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/state_machine/event.rb b/activemodel/lib/active_model/state_machine/event.rb
index e8bc8ebdb7..8acde7fd47 100644
--- a/activemodel/lib/active_model/state_machine/event.rb
+++ b/activemodel/lib/active_model/state_machine/event.rb
@@ -2,15 +2,15 @@ module ActiveModel
module StateMachine
class Event
attr_reader :name, :success
-
+
def initialize(machine, name, options = {}, &block)
@machine, @name, @transitions = machine, name, []
if machine
- machine.klass.send(:define_method, "#{name.to_s}!") do |*args|
+ machine.klass.send(:define_method, "#{name}!") do |*args|
machine.fire_event(name, self, true, *args)
end
- machine.klass.send(:define_method, "#{name.to_s}") do |*args|
+ machine.klass.send(:define_method, name.to_s) do |*args|
machine.fire_event(name, self, false, *args)
end
end