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 [49e943c4f0ac3459bd53023167aaa08fc8e46733] by Mat Brown

Revision 49e943c4f0ac3459bd53023167aaa08fc8e46733, committed by Mat Brown · December 2nd, 2009 @ 08:47 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/49e943c4f0ac3459bd53023167aaa0...

2 changed files

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