This is the code that is causing the error (FactoryGirl::Declaration::Static can't be coerced into Fixnum).
factory :detail do
k ["book","tvserie","movie"].sample
rc rand(1400000)
r 1+rand(10)+rand.round(1)
g generate_genres(self)
end
How can I sum and pass it as argument to the factory attribute?
Thanks.
Try putting the code to be executed in a block.
I'd also expect you'd need to specify the class for
generate_genres(self)
unless that method is defined in the factory. That's a technique I'm not familiar with.