On Tuesday, March 24, 2020 at 3:59:21 PM UTC-7, John Devine wrote: > > I have two models, foo and bar which have many_to_many associations with > each other. > > I would like to do > > foo.bars_dataset.update(status: 'ready') > > but that throws: Sequel::Error (Need multiple FROM tables if > updating/deleting a dataset with JOINs) > > Is there a simple way to update all the bars connected to my foo? >
Assuming you have a similar association on Bar: Bar.where(:foos=>foo).update(...) Thanks, Jeremy -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/20e4ecd8-35f9-42dc-b440-b1599ac2e6ed%40googlegroups.com.
