rails/rails — pull request #9529 by wangjohn (2013-03-03 18:23:31+00:00)
Title: Find() on an association with an inverse will now scan existing in-memory records

The problem in https://github.com/rails/rails/issues/9470 is that when a user defines ``:inverse_of`` in an association, the ``find()`` method does not check the records that are already loaded in the association, but will instead go to the database directly.

I've changed this so that when a user calls ``find()`` on an association which has an ``:inverse_of`` flag, then the ``find_by_scan()`` method is called, which basically does a scan over the loaded_target (which includes all current children, including new and existing records).