public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Some performance goodness for AM StateMatchine.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
clemens (author)
Tue Sep 02 01:54:04 -0700 2008
jeremy (committer)
Tue Sep 02 15:55:23 -0700 2008
commit  b42f53ca1fa0af0fd9cc37e2765cd9c47b100065
tree    88233e14e53c18dac99d637ee053a6e7b143620d
parent  948ed346007f0383c51fd371d594576f0fc9d699
...
2
3
4
5
 
6
7
8
9
 
10
11
12
13
 
14
15
16
...
2
3
4
 
5
6
7
8
 
9
10
11
12
 
13
14
15
16
0
@@ -2,15 +2,15 @@ module ActiveModel
0
   module StateMachine
0
     class Event
0
       attr_reader :name, :success
0
-      
0
+
0
       def initialize(machine, name, options = {}, &block)
0
         @machine, @name, @transitions = machine, name, []
0
         if machine
0
-          machine.klass.send(:define_method, "#{name.to_s}!") do |*args|
0
+          machine.klass.send(:define_method, "#{name}!") do |*args|
0
             machine.fire_event(name, self, true, *args)
0
           end
0
 
0
-          machine.klass.send(:define_method, "#{name.to_s}") do |*args|
0
+          machine.klass.send(:define_method, name.to_s) do |*args|
0
             machine.fire_event(name, self, false, *args)
0
           end
0
         end

Comments