Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Changeset [2f1ded306728ce8ff614e09a113398328e7fe6ca] by Mat Brown

Revision 2f1ded306728ce8ff614e09a113398328e7fe6ca, committed by Mat Brown · December 2nd, 2009 @ 08:46 PM

Fix instance_eval calls to association proxies

In the current stable, ActiveRecord::Associations::AssociationProxy#method_missing calls yield() if a block is given, causing the block to always be evaluated in its calling context. However, in the case of instance_eval, correct behavior requires that the block be passed directly to the @target, rather than being evaluated inside a different block. Incidentally, this also simplifies the code slightly.

[#3412 state:committed]

Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/2f1ded306728ce8ff614e09a113398...

2 changed files

  • M activerecord/lib/active_record/associations/association_proxy.rb
  • M activerecord/test/cases/associations/has_many_associations_test.rb