This project is archived and is in readonly mode.

#5271 ✓resolved
Jakub Kuźma

Touch does not propagate anymore

Reported by Jakub Kuźma | August 2nd, 2010 @ 08:36 AM | in 3.0.2

Since touch method has changed significantly, there no possibility to do something like this anymore:

class FirstModel < ActiveRecord::Base

end

class SecondModel < ActiveRecord::Base
  belongs_to :first_model, :touch => true
end

class ThirdModel < ActiveRecord::Base
  belongs_to :second_model, :touch => true
end

m = ThirdModel.first
m.touch # updates m record only, doesn't execute callbacks

m.attributes = { ... }
m.save! # updates m and m.second_model only

I think it was a really useful feature - I used it for caching or versioning several times. Is there any reason (apart from higher performance) to do it using update_attribute instead of saving the model?

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>

Referenced by

Pages