Sorry if was stating the obvious. Is the association polymorphic? I gather acts_as_list isn’t your friend there (not first hand knowledge, YMMV, BBQ). Though I’d naively expect it to break is a slightly different way than you report (like 1, 1, 2).
AB > On Jan 28, 2016, at 10:28 PM, Guyren Howe <[email protected]> wrote: > > On Jan 28, 2016, at 9:30 , Alex Boster <[email protected] > <mailto:[email protected]>> wrote: >> +1 for Rob’s suggestion. Check for gems that would create default scopes >> that aren’t necessarily obvious in the model file, like paranoia. > > Nice to see I have a reputation for something technical. :-) > > This: > > factory :order_with_segments do > after(:create) do |o| > segs = [ > create(:driving_segment1), > create(:flying_segment1), > create(:driving_segment2)] > segs.each do |seg| > o.delivery_route_segments << seg > end > produces segments with ids of 1, 2, 2. I've also tried just doing > > order.delivery_route_segments = segs > > with similar results. > > I wound up having to manually set the position values in SQL. But if I'm > doing that, what is acts_as_list doing for me, here? > > -- > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby <http://groups.google.com/group/sdruby> > --- > You received this message because you are subscribed to the Google Groups "SD > Ruby" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby --- You received this message because you are subscribed to the Google Groups "SD Ruby" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
