SwissDB icon indicating copy to clipboard operation
SwissDB copied to clipboard

Associations (belongs_to, has_many)

Open mixflame opened this issue 10 years ago • 5 comments

I don't care about the more advanced associations for now.

mixflame avatar Oct 20 '15 08:10 mixflame

Agreed

KCErb avatar Oct 20 '15 11:10 KCErb

We have pluralization working now and all of the inflections. This might be easier now.

mixflame avatar Nov 03 '15 04:11 mixflame

Will try this tomorrow

mixflame avatar Nov 07 '15 23:11 mixflame

With the current design of objects in my production app, neither of my models actually belongs to or has many of the other. So we will need to try this in the debug app instead.

mixflame avatar Nov 08 '15 12:11 mixflame

Just to help my self

Car has_many Tires # => Car.first.tires #=> Array of Tires belonging to Cars

Tires belongs_to Car # => Tire.first.car #=> SwissModel instance of Car which Tire belongs to

mixflame avatar Nov 08 '15 15:11 mixflame