diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-01 11:43:53 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-01 11:43:53 -0800 |
commit | 5c7fd8766586dba42fba6fc738a733175dd9d46b (patch) | |
tree | 5f1653b6ca1a307828b10c1013b84e1e4e41a97e /railties/lib | |
parent | 171172f324444a9ea9c98e4f3663c6e401fb3ec7 (diff) | |
parent | 12675988813e82ac30f7c0e0008c12c4cf5d8cdc (diff) | |
download | rails-5c7fd8766586dba42fba6fc738a733175dd9d46b.tar.gz rails-5c7fd8766586dba42fba6fc738a733175dd9d46b.tar.bz2 rails-5c7fd8766586dba42fba6fc738a733175dd9d46b.zip |
Merge remote branch 'jonleighton/association_fixes' into fuuu
* jonleighton/association_fixes:
Rename AssociationReflection#primary_key_name to foreign_key, since the options key which it relates to is :foreign_key
Support for :counter_cache on polymorphic belongs_to
Refactor BelongsToAssociation to allow BelongsToPolymorphicAssociation to inherit from it
Specify the STI type condition using SQL IN rather than a whole load of ORs. Required a fix to ActiveRecord::Relation#merge for properly merging create_with_value. This also fixes a situation where the type condition was appearing twice in the resultant SQL query.
Verify that when has_many associated objects are destroyed via :dependent => :destroy, when the parent is destroyed, the callbacks are run
Get rid of extra_conditions param from configure_dependency_for_has_many. I can't see a particularly plausible argument for this being used by plugins, and if they really want they can just redefine the callback or whatever. Note also that before my recent commit the extra_conditions param was completely ignored for :dependent => :destroy.
And owner_quoted_id can go too
Now we can drop-kick AssociationReflection#dependent_conditions into oblivion.
Refactor configure_dependency_for_has_many to use AssociationCollection#delete_all. It was necessary to change test_before_destroy in lifecycle_test.rb so that it checks topic.replies.size *before* doing the destroy, as afterwards it will now (correctly) be 0.
Diffstat (limited to 'railties/lib')
0 files changed, 0 insertions, 0 deletions