This project is archived and is in readonly mode.
revise #to_a in associations
Reported by Xavier Noria | March 12th, 2010 @ 07:32 PM
Currently #to_a is removed from AssociationProxy.
If you do Array(post.author) method_missing sends #to_a to the
@target, which invokes Kernel#to_a directly. That issues a warning
"warning: default to_a' will be obsolete".
This patch keeps #to_a in AssociationProxy so that Array() works normally, and delegates #to_a to the @target by hand in association collections.
Comments and changes to this ticket
-
Repository March 12th, 2010 @ 07:54 PM
- State changed from new to committed
(from [fe43bbd8c71fabb4b612808c42461b2ba9655318]) keep AssociationProxy#to_a to avoid warning in Array(post.author), and delegate it to @target in association collections
[#4165 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/fe43bbd8c71fabb4b612808c42461b... -
Josh Sharpe May 27th, 2010 @ 09:54 PM
- Assigned user set to Jeremy Kemper
This bug actually exists on on the 2-3 branch as well and just bit us. Should this also be applied there?
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>
People watching this ticket
Attachments
Referenced by
- 4165 revise #to_a in associations [#4165 state:committed]