Skip to content

Commit

Permalink
Provide explanation for why a transition cannot be made.
Browse files Browse the repository at this point in the history
  • Loading branch information
eric committed Jul 9, 2008
1 parent 59eb4a3 commit c687591
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/event.rb
Expand Up @@ -14,7 +14,7 @@ def initialize(name, options = {}, &block)

def fire(obj, to_state=nil, *args)
transitions = @transitions.select { |t| t.from == obj.aasm_current_state }
raise AASM::InvalidTransition if transitions.size == 0
raise AASM::InvalidTransition, "Event '#{name}' cannot transition from '#{obj.aasm_current_state}'" if transitions.size == 0

next_state = nil
transitions.each do |transition|
Expand Down

0 comments on commit c687591

Please sign in to comment.