我有一个模型,它指定了一个之前的destroy回调。类似的东西:
Class User < ActiveRecord::Base
before_destroy :do_destroy
acts_as_destroyable
private
def do_destroy
puts "A"
end
end
module ActsAsDestroyable
def self.included(base)
base.send(:extend, ActsMethods)
end
module ActsMethods
def acts_as_destroyable(options = {})
self.send(:include, InstanceMethods)
end
module InstanceMethods
def do_something
puts "A0"
end
def self.included(base)
base.before_destroy :do_something
end
end
end
end
现在,由于Destroyable模块与用户的协议一起使用,因此需要在“do_destroy”回调之前执行其“do_domething”方法。任何想法如何将其向上移动回调队列?