Hi

I guess you must have answered this before, I tried to look for the answer, 
but couldn't find anywhere. So, my apologies for the repeat. 

I have a one_to_many defined. Now, I want to add them all at once:

class Car
  one_to_many :wheels
end

# this works
4.times.each { Car.first.add_wheel(Wheel.new)}
# this would work in AR
Car.first.wheels = 4.times.map { Wheel.new }

>From what I see, the model doesn't provide the setter method in plain 
sequel. So I guess there must be an extension for this, although I couldn't 
find anything in the documentation. 

To be honest, I'd go for a workaround with the add_ methods, but the 
problem is, I'm using factory girl for my specs, and some of them involve 
settings some associations like:

create(:car, wheels: [Wheel.new....

So, I kind of need those, or a decent enough workaround. 

Thx in advance
Tiago 

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to