<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,6 +9,3 @@
 * Real transition actions
 
 * Default states
-
-* Entry/exit actions and guards can be a symbol representing a method name
-  instead of a proc.
\ No newline at end of file</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ module RailsStudio                   #:nodoc:
           end
           
           def guard(obj)
-            @guard ? @guard.call(obj) : true
+            @guard ? obj.send(:run_transition_action, @guard) : true
           end
           
           def ==(obj)
@@ -79,6 +79,15 @@ module RailsStudio                   #:nodoc:
             s.from == current_state
           end
         end
+
+        def run_transition_action(action)
+          if action.kind_of?(Symbol)
+            self.method(action).call
+          else
+            action.call(self)
+          end
+        end
+        private :run_transition_action
       end
 
       module ClassMethods
@@ -120,9 +129,11 @@ module RailsStudio                   #:nodoc:
                 exitact  = self.class.read_inheritable_attribute(:states)[current_state][:exit]
                 enteract = self.class.read_inheritable_attribute(:states)[ns.to][:enter]
                 
-                enteract.call(self) if enteract &amp;&amp; !loopback
+                run_transition_action(enteract) if enteract &amp;&amp; !loopback
+                
                 self.update_attribute(self.class.state_column, ns.to.to_s)
-                exitact.call(self) if exitact &amp;&amp; !loopback
+                
+                run_transition_action(exitact) if exitact &amp;&amp; !loopback
                 break
               end
             end</diff>
      <filename>lib/acts_as_state_machine.rb</filename>
    </modified>
    <modified>
      <diff>@@ -117,6 +117,11 @@ class ActsAsStateMachineTest &lt; Test::Unit::TestCase
     assert !c.read_exit
   end
   
+  def test_run_transition_action_is_private
+    c = Conversation.create
+    assert_raise(NoMethodError) { c.run_transition_action :foo }
+  end
+  
   def test_find_all_in_state
     cs = Conversation.find_in_state(:all, :read)
     </diff>
      <filename>test/acts_as_state_machine_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ class Conversation &lt; ActiveRecord::Base
   acts_as_state_machine :initial =&gt; :needs_attention, :column =&gt; 'state_machine'
   
   state :needs_attention
-  state :read, :enter =&gt; Proc.new { |o| o.read_enter = true },
+  state :read, :enter =&gt; :read_enter_action,
                :exit  =&gt; Proc.new { |o| o.read_exit  = true }
   state :closed
   state :awaiting_response
@@ -22,10 +22,10 @@ class Conversation &lt; ActiveRecord::Base
   event :reply do
     transitions :to =&gt; :awaiting_response, :from =&gt; [:read, :closed]
   end
-  
+
   event :close do
     transitions :to =&gt; :closed,            :from =&gt; [:read, :awaiting_response], :guard =&gt; Proc.new {|o| o.can_close?}
-    transitions :to =&gt; :read,              :from =&gt; [:read, :awaiting_response]
+    transitions :to =&gt; :read,              :from =&gt; [:read, :awaiting_response], :guard =&gt; :always_true
   end
   
   event :junk do
@@ -39,4 +39,12 @@ class Conversation &lt; ActiveRecord::Base
   def can_close?
     @can_close
   end
+  
+  def read_enter_action
+    self.read_enter = true
+  end
+  
+  def always_true
+    true
+  end
 end</diff>
      <filename>test/fixtures/conversation.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>60c625fb97d0c2c0693d7e12b903bfe4c3148695</id>
    </parent>
  </parents>
  <author>
    <name>sbarron</name>
    <email>sbarron@a9f67fa3-8408-0410-ad84-b6cefbfd10ac</email>
  </author>
  <url>http://github.com/sudothinker/acts_as_state_machine/commit/ff00b78fd51eecc781ef5ebee78d883371e42294</url>
  <id>ff00b78fd51eecc781ef5ebee78d883371e42294</id>
  <committed-date>2006-01-20T12:25:05-08:00</committed-date>
  <authored-date>2006-01-20T12:25:05-08:00</authored-date>
  <message>

git-svn-id: http://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk@45 a9f67fa3-8408-0410-ad84-b6cefbfd10ac</message>
  <tree>ead94eb2f433bcd0a83606fed229f0315f25f89b</tree>
  <committer>
    <name>sbarron</name>
    <email>sbarron@a9f67fa3-8408-0410-ad84-b6cefbfd10ac</email>
  </committer>
</commit>
