mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Fix: _fire method is too long issue
This commit is contained in:
parent
b0f035e8e1
commit
ee212acd30
1 changed files with 3 additions and 3 deletions
|
@ -131,14 +131,14 @@ module AASM::Core
|
|||
|
||||
if to_state == ::AASM::NO_VALUE
|
||||
to_state = nil
|
||||
elsif to_state.respond_to?(:to_sym) && transitions.map(&:to).flatten.include?(to_state.to_sym)
|
||||
# nop, to_state is a valid to-state
|
||||
else
|
||||
elsif !(to_state.respond_to?(:to_sym) && transitions.map(&:to).flatten.include?(to_state.to_sym))
|
||||
# to_state is an argument
|
||||
args.unshift(to_state)
|
||||
to_state = nil
|
||||
end
|
||||
|
||||
# nop, to_state is a valid to-state
|
||||
|
||||
transitions.each do |transition|
|
||||
next if to_state and !Array(transition.to).include?(to_state)
|
||||
if (options.key?(:may_fire) && transition.eql?(options[:may_fire])) ||
|
||||
|
|
Loading…
Reference in a new issue