-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentError: wrong number of arguments when first argument is nil #441
Comments
I think i found the problem, working on a patch at the moment |
It looks like its this method definition which removes the first argument, because to_state is nil: # Call starts here:
#aasm/lib/aasm/aasm.rb @ line 113
if may_fire_to = event.may_fire?(self, *args)
#which leads to following parameter conversion:
#aasm/lib/aasm/core/event.rb @ line 44 AASM::Core::Event#may_fire?
43: def may_fire?(obj, to_state=nil, *args)
=> 44: binding.pry if args.size == 1
45: puts "#{caller[0]}\t#{args.to_s}" # debug
46: _fire(obj, {:test_only => true}, to_state, *args) # true indicates test firing
47: end
[1] pry(#<AASM::Core::Event>)> to_state
=> nil
[2] pry(#<AASM::Core::Event>)> args
=> ["yuppi"] Don't know how to refactor this though... |
@werleo Can you run your specs on master branch and let me know if this issue is resolved ? |
@anilmaurya test is passing on master branch. Test is in PR https://github.com/aasm/aasm/pull/485/files |
I would like to merge #485 , can you rename |
Renamed. |
When first argument to event is nil it is removed from argument list.
In consequence we get:
Test scenario:
werleo@354e05f
The text was updated successfully, but these errors were encountered: