Skip to content

Commit

Permalink
added more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Jones committed Mar 1, 2012
1 parent 0c61b86 commit c228fbf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/state_machine/transition_collection.rb
Expand Up @@ -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
Expand Down Expand Up @@ -184,6 +189,7 @@ def within_transaction
end
else
puts "executing not in a transaction"

yield
end
end
Expand Down

0 comments on commit c228fbf

Please sign in to comment.