diff options
author | Clemens Kofler <clemens@railway.at> | 2008-09-02 10:54:04 +0200 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-09-03 00:55:23 +0200 |
commit | b42f53ca1fa0af0fd9cc37e2765cd9c47b100065 (patch) | |
tree | 88233e14e53c18dac99d637ee053a6e7b143620d /activemodel/lib/active_model/state_machine | |
parent | 948ed346007f0383c51fd371d594576f0fc9d699 (diff) | |
download | rails-b42f53ca1fa0af0fd9cc37e2765cd9c47b100065.tar.gz rails-b42f53ca1fa0af0fd9cc37e2765cd9c47b100065.tar.bz2 rails-b42f53ca1fa0af0fd9cc37e2765cd9c47b100065.zip |
Some performance goodness for AM StateMatchine.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activemodel/lib/active_model/state_machine')
-rw-r--r-- | activemodel/lib/active_model/state_machine/event.rb | 6 |
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 |