This project is archived and is in readonly mode.

#4711 ✓wontfix
Paul Rosania

[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

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>

Attachments

Pages