This project is archived and is in readonly mode.
[PATCH] Rails 3: fields_for helper doesn't work with association proxy objects
Reported by Paul Rosania | May 27th, 2010 @ 01:14 AM
[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.
Comments and changes to this ticket
-
Michael Koziarski May 29th, 2010 @ 02:38 AM
- 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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>