This project is archived and is in readonly mode.

#1751 ✓wontfix
Eloy Duran

AssociationCollection #first and #last cache.

Reported by Eloy Duran | January 13th, 2009 @ 07:39 PM | in 2.x

Sometimes when testing or in irb, I seem to forget that the following does not work:


first = firm.clients.first
firm.clients.each { ... } # loads the target and thus the instance is gone
firm.clients.first.object_id == first.object_id # => false

This patch solves this.

Note that the same queries as normal are executed, just the instance in the collection result is replaced.

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>

People watching this ticket

Attachments

Referenced by

Pages