Can “touch” be used on a belongs_to polymorphic relationship in Rails?

I expected the following to work:

class Attachment < ActiveRecord::Base
   belongs_to :attachable, :polymorphic => true, :touch => true
end

which I expect the associated objects to be "touched" when the Attachment record is saved or destroyed. It didn't work. Any ideas why?

5
задан Dia Kharrat 12 February 2011 в 07:46
поделиться