I expected the following to work:
class Attachment < ActiveRecord::Base belongs_to :attachable, :polymorphic => true, :touch => true end
which I expect related objects to be “affected” when the attachment record is saved or destroyed. This did not work. Any ideas why?
Yes, that should work. I used this in several projects (2.3.x and 3.0.x), and it just works.
touch : attachment.attachable.touch, , updated_at. , : touch .