Closed emmanuelmillionaer closed 7 years ago
When page-content get's updated, update related page updated_at-time as well
updated_at
touch does not perform callbacks etc. http://apidock.com/rails/v4.2.7/ActiveRecord/Persistence/touch
touch
And uses update_all under the hood: http://apidock.com/rails/v4.0.2/ActiveRecord/Relation/update_all
update_all
(From the docs) This method constructs a single SQL UPDATE statement and sends it straight to the database. It does not instantiate the involved models and it does not trigger Active Record callbacks or validations.
What
When page-content get's updated, update related page
updated_at
-time as wellRelated Links
touch
does not perform callbacks etc. http://apidock.com/rails/v4.2.7/ActiveRecord/Persistence/touchAnd uses
update_all
under the hood: http://apidock.com/rails/v4.0.2/ActiveRecord/Relation/update_all(From the docs) This method constructs a single SQL UPDATE statement and sends it straight to the database. It does not instantiate the involved models and it does not trigger Active Record callbacks or validations.
Gif