collectiveidea/awesome_nested_set — pull request #224 by rathgar (2013-12-23 08:17:31+00:00)
Title: Optionally touch all ancestors on save

On the [belongs_to](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-belongs_to) association there is the option to touch the associated object updating its `created_at`.

Exposing this option is extremely useful. The simplest example is if you use nested set as a nested navigational element and are fragment caching each node and then entire menu ([Russian doll caching](http://blog.remarkablelabs.com/2012/12/russian-doll-caching-cache-digests-rails-4-countdown-to-2013)). Editing any of the lower nodes your menu will not allow items further up to be re-cached. Setting `touch: true` on the `belongs_to` relationship will tell AcriveRecord to touch this, and this works all the way up the ancestry.

*note: This PR is against current 2-1-stable but will equally apply to ~> 3.0*