Commit #9668 shows warning when `delete_all` is invoked with `:dependent` option `:destroy`. Unfortunately invoking `Post.destroy_all` invokes `post.comments.delete_all` as part of `has_many` callbacks. This commit ensures that instead `post.comments.destroy_all` is invoked and in the process no warning is generated. See issue #9567 for details .
This reverts commit 3803fcc. Conflicts: activerecord/CHANGELOG.md It will be deprecated only in 4.0, and removed properly in 4.1.
… is present but the record is unsaved
If we're deleting all records in an association, don't add a IN(..) clause to the query. Fixes #3672.
…ation. Fixes #1360.
…neric AssociationScope class which is capable of building a scope for any association.
…ethods, callbacks etc) rather than calling a whole bunch of methods with rather long names.
…on.options' with 'options'. Also add through_options and source_options methods for through associations.
…rectly accessing the instance variables
…ch manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more.
…roy to be more consistent with each other, and to stop passing blocks around, thus making the execution easier to follow.
state:resolved]. Also fixed a bunch of other counter cache bugs in the process, as once I fixed this one others started appearing like nobody's business.
…te records in the join table. This is to make the destroy method more consistent across the different types of associations. For more details see the CHANGELOG entry.
… scope, rather than a hash which is passed to apply_finder_options. This allows more flexibility in how the scope is created, for example because scope.where(a, b) and scope.where(a).where(b) mean different things.
…at I am removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences.
…he options key which it relates to is :foreign_key
…mongst other things
…e it all use arel rather than SQL strings