mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Fix failures array in transition not being reset
This commit is contained in:
parent
a8755d52f5
commit
de1e99bdd0
1 changed files with 1 additions and 0 deletions
|
@ -139,6 +139,7 @@ module AASM::Core
|
||||||
end
|
end
|
||||||
|
|
||||||
transitions.each do |transition|
|
transitions.each do |transition|
|
||||||
|
transition.failures.clear #https://github.com/aasm/aasm/issues/383
|
||||||
next if to_state and !Array(transition.to).include?(to_state)
|
next if to_state and !Array(transition.to).include?(to_state)
|
||||||
if (options.key?(:may_fire) && transition.eql?(options[:may_fire])) ||
|
if (options.key?(:may_fire) && transition.eql?(options[:may_fire])) ||
|
||||||
(!options.key?(:may_fire) && transition.allowed?(obj, *args))
|
(!options.key?(:may_fire) && transition.allowed?(obj, *args))
|
||||||
|
|
Loading…
Reference in a new issue