Re: managing join table additional attributes

2021-09-07 Thread Jeremy Evans
On Sat, Sep 4, 2021 at 5:41 PM John Knapp wrote: > I have a standard many_to_ many with a model for the join table. The join > table has an extra attribute, "quantity". > > class Plan < Sequel::Model > many_to_many :capabilities > end > > # join table with extra column "quantity" > class Capa

Re: managing join table additional attributes

2021-09-06 Thread Rob Galanakis
Jeremy can answer authoritatively but AFAIK it does not exist and is a bit of an oxymoron- "join tables" as Sequel defines them are just a compound key; adding an additional attribute ceases to make them a join table. I'm not going to explain why you should use a separate model for this since yo

Re: managing join table additional attributes

2021-09-05 Thread John Knapp
Thanks Rob, I actually have both but we can forget that model for the moment. The join table has an additional column "quantity". My objective is learning the correct sequel syntax to add a specified *quantity* of a given capability (c) into a plan (p) while using the sequel add_*association* m

Re: managing join table additional attributes

2021-09-05 Thread Rob Galanakis
To me, that seems like you'd want a separate model, not a join table. - Rob On Saturday, September 4, 2021 at 5:41:11 PM UTC-7 John Knapp wrote: > I have a standard many_to_ many with a model for the join table. The join > table has an extra attribute, "quantity". > > class Plan < Sequel::Model

managing join table additional attributes

2021-09-04 Thread John Knapp
I have a standard many_to_ many with a model for the join table. The join table has an extra attribute, "quantity". class Plan < Sequel::Model many_to_many :capabilities end # join table with extra column "quantity" class CapabilitiesPlans < Sequel::Model end class Capability < Sequel::Mode