我想做以下事情:
after_commit :on => :destroy do
Advert.clean_total_active_cache
end
但以类似观察者的方式:
class AdvertObserver < ActiveRecord::Observer
def after_commit advert
Advert.clean_total_active_cache
end
end
这是“:on =>:destroy”,这给我带来了麻烦,我该如何指定?