There is a good example of an ActiveRecord extension to provide skipping callbacks here: http://weareintegrum.com/?p=10
The idea is to create an ActiveRecord method called skip_callback that takes a block:
def self.skip_callback(callback, &block) method = instance_method(callback) remove_method(callback) if respond_to?(callback) define_method(callback){ true } begin result = yield ensure remove_method(callback) define_method(callback, method) end result end
Then everything you do in the block does not call back.
source share