You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading through the cookbook's Single Table Inheritance article and found it very useful, but I noticed it's missing one key part: dealing with relations.
It would be great if you could add an explanation on how to declare relations from a regular AR to a STI AR and vice versa. For example, in the article there is a Car AR. Could we add for example a hypothetical AR called Vendor which has a getCars() (and maybe getSportCars(), getHeavyCars()) relation(s) pointing to Car? And then a hasOne getVendor() relation in Car pointing back to Vendor. Maybe briefly touch on how inverseOf would work in that case.
The text was updated successfully, but these errors were encountered:
Hi Samdark,
I was reading through the cookbook's Single Table Inheritance article and found it very useful, but I noticed it's missing one key part: dealing with relations.
It would be great if you could add an explanation on how to declare relations from a regular AR to a STI AR and vice versa. For example, in the article there is a
Car
AR. Could we add for example a hypothetical AR calledVendor
which has agetCars()
(and maybegetSportCars()
,getHeavyCars()
) relation(s) pointing toCar
? And then a hasOnegetVendor()
relation inCar
pointing back toVendor
. Maybe briefly touch on howinverseOf
would work in that case.The text was updated successfully, but these errors were encountered: