rails/rails — pull request #11001 by Empact (2013-06-18 22:24:22+00:00)
Title: A failing test which shows that when a collection association is accessed before saving the owner, the proxy caches the #bind_values from before the owner being persisted.

This causes calls like: owner.association.update_all to behave unexpectedly
in this case, because they try to act on association objects where
owner_id is null.

This is related to #bind_values being set on first access at:
https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations/collection_proxy.rb#L37

Not sure how to properly deal with this, but it is the case that calling update all on
the #scope of the association works.