Skip to content
Browse files

added more logging

  • Loading branch information...
1 parent 0c61b86 commit c228fbfa641ffb7529347b20a4649e3b6c446c82 Trevor Jones committed Mar 1, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/state_machine/transition_collection.rb
View
8 lib/state_machine/transition_collection.rb
@@ -49,17 +49,22 @@ def initialize(transitions = [], options = {})
# of invoking each transition's action.
def perform(&block)
reset
-
+
+ puts 'in perform'
+
if valid?
if use_event_attributes? && !block_given?
+ puts 'looping the transitions'
each do |transition|
transition.transient = true
transition.machine.write(object, :event_transition, transition)
end
run_actions
else
+ puts 'not using event'
within_transaction do
+ puts 'inside the within transaction block'
catch(:halt) { run_callbacks(&block) }
rollback unless success?
end
@@ -184,6 +189,7 @@ def within_transaction
end
else
puts "executing not in a transaction"
+
yield
end
end

0 comments on commit c228fbf

Please sign in to comment.
Something went wrong with that request. Please try again.