Closed abacha closed 7 years ago
FactoryGirl was triggering 'touch' with params and in acts-as this method doesnt accept any params. ActiveRecord definition of touch receives params:
def touch(*) #:nodoc:
with_transaction_returning_status { super }
end
`ArgumentError: wrong number of arguments (2 for 0)
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/configuration.rb:18:in `block in initialize'
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/evaluation.rb:15:in `[]'
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/evaluation.rb:15:in `create'
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/strategy/create.rb:12:in `block in result'
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/strategy/create.rb:9:in `tap'
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/strategy/create.rb:9:in `result'
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/factory.rb:42:in `run'
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/factory_runner.rb:29:in `block in run'
# /home/abacha/.rvm/gems/ruby-2.2.5@bigbang_services/gems/factory_girl-4.8.0/lib/factory_girl/factory_runner.rb:28:in `run'
`
Thanks for your contribution, @abacha! Didn't know before that touch
accepted arguments... 😄
I implemented it so that the arguments are forwarded to the supermodel.
v2.0.6 is released, can you try it out if it works for you?
@manuelmeurer now its only touching the super object not the child
As mentioned in #87, the canonical repo for this gem has moved to https://github.com/krautcomputing/active_record-acts_as Please open an issue there with a code example of what is happening.
What exactly is the bug? 😄