如何跳过active_record 回调

 1 def self.clear_superclass_callbacks
 2     [:before_create,:after_create,:after_update,:before_destroy].each do |callback|
 3       class_eval <<-"end_eval"
 4             def self.#{callback}_callback_chain
 5                             @#{callback}_callbacks || CallbackChain.new
 6             end
 7       end_eval
 8     end
 9   end
10 
11   clear_superclass_callbacks


posted @ 2010-03-17 17:23  麦飞  阅读(186)  评论(0编辑  收藏  举报