diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2012-09-17 22:03:34 +0300 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2012-09-17 22:03:34 +0300 |
commit | e9acafd984ef64b44a8f0c998acaddbdce1dd6fb (patch) | |
tree | b0092a03d19408c3f7ea09639ec17bff9c654c07 /guides | |
parent | f5654e78b248ecc90e8556366c927e1176c2428f (diff) | |
download | rails-e9acafd984ef64b44a8f0c998acaddbdce1dd6fb.tar.gz rails-e9acafd984ef64b44a8f0c998acaddbdce1dd6fb.tar.bz2 rails-e9acafd984ef64b44a8f0c998acaddbdce1dd6fb.zip |
Add note about inheretance and poly associations.
This note came about due to discussion in #6786.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/association_basics.textile | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/guides/source/association_basics.textile b/guides/source/association_basics.textile index 151752eee9..e991a309ff 100644 --- a/guides/source/association_basics.textile +++ b/guides/source/association_basics.textile @@ -338,6 +338,10 @@ end !images/polymorphic.png(Polymorphic Association Diagram)! +Polymorphic associations can get tricky with inheritance. If you need +an inheritance relationship in your ActiveRecord models, you should use +Single Table Inheritance instead. + h4. Self Joins In designing a data model, you will sometimes find a model that should have a relation to itself. For example, you may want to store all employees in a single database model, but be able to trace relationships such as between manager and subordinates. This situation can be modeled with self-joining associations: |