rails/rails — pull request #14979 by brocktimus (2014-05-05 12:42:07+00:00)
Title: Making belongs_to: touch behaviour be consistent with save updating updated_at

If no attributes have been changed and save is called on a record the updated_at timestamp isn't updated. However if there is a belongs_to: touch enabled it propagates up the tree, and thus busts any cache keys despite nothing having changed.

That is how I hit the problem. I have an application that just calls save while processing records, regardless of if the records had changed. It was slowing down due to the increased number of queries in addition to busting all the cache keys.

Main question is do I need to change the UPGRADE notes or similar since it does break backwards compat if this was being relied upon?

Then a couple of super minor things:
* Is the test name fine?
* Should I use an entirely separate callback instead of passing the if?
* The callbacks are otherwise in increasing line length, should I move mine to the end?