aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/through_association.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow assignment on has_one :through where the owner is a new record [#5137 ↵Jon Leighton2011-01-031-13/+7
| | | | | | | | | | state:resolved] This required changing the code to keep the association proxy for a belongs_to around, despite its target being nil. Which in turn required various changes to the way that stale target checking is handled, in order to support various edge cases (loaded target is nil then foreign key added, foreign key is changed and then changed back, etc). A side effect is that the code is nicer and more succinct. Note that I am removing test_no_unexpected_aliasing since that is basically checking that the proxy for a belongs_to *does* change, which is the exact opposite of the intention of this commit. Also adding various tests for various edge cases and related things. Phew, long commit message!
* Have a proper AssociationReflection#foreign_type method rather than using ↵Jon Leighton2011-01-031-2/+2
| | | | options[:foreign_type]
* Rename AssociationReflection#primary_key_name to foreign_key, since the ↵Jon Leighton2010-12-311-5/+5
| | | | options key which it relates to is :foreign_key
* Refactor BelongsToAssociation to allow BelongsToPolymorphicAssociation to ↵Jon Leighton2010-12-311-2/+0
| | | | inherit from it
* Add a HasAssociation module for common code for has_* associationsJon Leighton2010-12-261-0/+169