From a570be18119984537675e4d49310e2f7c86a8946 Mon Sep 17 00:00:00 2001 From: chris2tof Date: Thu, 1 Sep 2011 18:28:04 +0800 Subject: [PATCH] Skip callbacks --- config/initializers/without_callbacks.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 config/initializers/without_callbacks.rb diff --git a/config/initializers/without_callbacks.rb b/config/initializers/without_callbacks.rb new file mode 100644 index 00000000..06ba4e0a --- /dev/null +++ b/config/initializers/without_callbacks.rb @@ -0,0 +1,7 @@ +module ActiveSupport::Callbacks::ClassMethods + def without_callback(*args, &block) + skip_callback(*args) + yield + set_callback(*args) + end +end \ No newline at end of file