Permalink
Browse files

Fix target state being indeterminate for transitions that use blacklists

  • Loading branch information...
1 parent c3b05c3 commit b3914bcc3c14dd2a5482c48b4cf91aef475d0930 @obrie obrie committed Mar 31, 2013
Showing with 3 additions and 1 deletion.
  1. +1 −0 CHANGELOG.md
  2. +2 −1 lib/state_machine/event.rb
View
@@ -1,5 +1,6 @@
# master
+* Fix target state being indeterminate for transitions that use blacklists
* Allow super to be called within state-driven behaviors
## 1.2.0 / 2013-03-30
@@ -147,7 +147,8 @@ def transition_for(object, requirements = {})
to = if match[:to].is_a?(LoopbackMatcher)
from
else
- values = requirements.include?(:to) ? [requirements[:to]].flatten : [from] | machine.states.keys(:name)
+ values = requirements.include?(:to) ? [requirements[:to]].flatten : [from] | machine.states.map {|state| state.name}
+
match[:to].filter(values).first
end

0 comments on commit b3914bc

Please sign in to comment.