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.

[PATCH] Rails 3: fields_for helper doesn't work with association proxy objects

#4711

[Tested against latest Rails 3 edge.]

Mongoid uses association proxy objects. It overrides #nil? => false when the association is missing. However since it uses proxy objects, !!assocation is always true.

This patch changes the association nil test to call assocation.nil? rather than use implicit coercion of the variable.

Reported by Paul Rosania · May 27th, 2010 @ 01:14 AM

State: wontfix
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Michael Koziarski
    Michael Koziarski
    • State changed from new to wontfix

    These proxy objects don't follow correct ruby semantics and I'm not entirely sure that we should take the performance hit to work around that bug. There are bound to be other places where we use this form and we're not going to fix all of them.

    May 29th, 2010 @ 02:38 AM

  2. bingbing