<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -174,6 +174,7 @@ module Workflow
     def initialize(states, on_transition, meta = {}, reconstitute_at = nil)
       Workflow.logger.debug &quot;Creating workflow instance&quot;
       @states, @on_transition, @meta = states, on_transition, meta
+      @context = self
       if reconstitute_at.nil?
         transition(nil, states.first, nil)
       else
@@ -318,22 +319,22 @@ module Workflow
     end
 
     def run_on_transition(from, to, event, *args)
-      self.instance_exec(from.name, to.name, event, *args, &amp;on_transition) if on_transition
+      context.instance_exec(from.name, to.name, event, *args, &amp;on_transition) if on_transition
     end
 
     def run_action(action, *args)
-      self.instance_exec(*args, &amp;action) if action
+      context.instance_exec(*args, &amp;action) if action
     end
 
     def run_on_entry(state, prior_state, triggering_event, *args)
       if state.on_entry
-        self.instance_exec(prior_state.name, triggering_event, *args, &amp;state.on_entry)
+        context.instance_exec(prior_state.name, triggering_event, *args, &amp;state.on_entry)
       end
     end
 
     def run_on_exit(state, new_state, triggering_event, *args)
       if state and state.on_exit
-        self.instance_exec(new_state.name, triggering_event, *args, &amp;state.on_exit)
+        context.instance_exec(new_state.name, triggering_event, *args, &amp;state.on_exit)
       end
     end
 </diff>
      <filename>lib/workflow.rb</filename>
    </modified>
    <modified>
      <diff>@@ -185,6 +185,7 @@ describe &quot;Active Record Workflow&quot; do
               name.upcase! unless name.nil?
             end
           end
+          state :second
         end
       end
 </diff>
      <filename>specs/active_record_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -191,22 +191,22 @@ describe 'Workflow:' do
 
     before do
       Workflow.specify do
-        state(:first)  { event(:next, :transitions_to =&gt; :second) {|i| context.record i }}
-        state(:second) { event(:next, :transitions_to =&gt; :third)  {|i| context.record i }}
+        state(:first)  { event(:next, :transitions_to =&gt; :second) {|i| record i }}
+        state(:second) { event(:next, :transitions_to =&gt; :third)  {|i| record i }}
         state :third do
           event(:next, :transitions_to =&gt; :fourth)
           event(:back, :transitions_to =&gt; :second) {|i| record i }
           on_entry do |prior_state, triggering_event, *event_args|
-            context.record 'entered :third'
+            record 'entered :third'
           end
           on_exit do |new_state, triggering_event, *event_args|
-            context.record 'exited :third'
+            record 'exited :third'
           end
         end
         state :fourth
         on_transition do |from, to, triggering_event, *args|
           begin
-            context.record &quot;transitioned from #{from} to #{to}&quot;
+            record &quot;transitioned from #{from} to #{to}&quot;
           rescue
             # ok ok shit fuck cunt arse motherfucker, nomethoderror
             # TODO: reraising on our behalfs were casing this to bunk up</diff>
      <filename>specs/workflow_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c23bcfa49fa4c244c0b7d66b08277dac991ef345</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Allen</name>
    <email>ryan@yeahnah.org</email>
  </author>
  <url>http://github.com/ryan-allen/workflow/commit/bf2f16172d69ad205e3a31ba0f441c1c90acecc0</url>
  <id>bf2f16172d69ad205e3a31ba0f441c1c90acecc0</id>
  <committed-date>2009-01-15T18:22:52-08:00</committed-date>
  <authored-date>2009-01-15T18:22:52-08:00</authored-date>
  <message>specs are passing i think</message>
  <tree>d744279be36b4f543ecb2aa3e2277fcc0690cbff</tree>
  <committer>
    <name>Ryan Allen</name>
    <email>ryan@yeahnah.org</email>
  </committer>
</commit>
