I'm currently working on a Rails 2.3 project but I think the code hasn't 
changed much around touching in the latest release so here goes:

Touching seems to be less efficient than it could be. Currently it seems to 
change the updated_at (or other) field, save the whole object, trigger all 
callbacks on that object (some of which might be to touch other associated 
objects) and so on.

Seems to me that there could be performance gains made (especially when it 
comes to deleting and cloning deeply nested relational structures) by 
making touch only update_attribute the appropriate fields, and then only 
call the associated touch callbacks (because they're already named well 
they can be identified) and so on.

Is there a reason why it's not does this way already?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-core/-/THT-W4w5MvsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to