This project is archived and is in readonly mode.

#3678 ✓stale
Will Bryant

Small tweak to fix unnecessary duping and loading

Reported by Will Bryant | January 10th, 2010 @ 12:15 AM | in 2.3.10

Commit 8056c57 fixed #2397, but it introduces a little inefficiency to every non-dirty record save - it calls attributes rather than using @attributes, resulting in the entire attributes hash being duped on every save.

It also causes extra attribute loads if you're using a lazy-loading plugin such as http://github.com/willbryant/columns_on_demand, which is unnecessary - if the attributes aren't already loaded, they can't be dirty.

Attached tiny patch against 2-3-stable changes attributes to @attributes, tests are still happy.

This does apply cleanly to master also - but you need to cherry-pick 8056c57 first, it seems to have been left out so far (but should be applied as the same #2397 issue exists in master).

Sound OK?

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>

Pages