aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-08-05 16:57:20 -0400
committerNeeraj Singh <neerajdotname@gmail.com>2010-08-06 01:51:11 -0400
commitd0ac56b5b4194bdf36bbd3b49ad64649b0675c66 (patch)
treec3e9365ae5a9c2c97cde33f5d881d8ac0b921331 /activesupport/lib
parentd62700f7dc0082b0acd9129350af23ee93ab6e19 (diff)
downloadrails-d0ac56b5b4194bdf36bbd3b49ad64649b0675c66.tar.gz
rails-d0ac56b5b4194bdf36bbd3b49ad64649b0675c66.tar.bz2
rails-d0ac56b5b4194bdf36bbd3b49ad64649b0675c66.zip
adding an example of skipping a callback
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/callbacks.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 7290c971f9..24e407c253 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -486,7 +486,11 @@ module ActiveSupport
end
end
- # Skip a previously defined callback for a given type.
+ # Skip a previously defined callback.
+ #
+ # class Writer < Person
+ # skip_callback :validate, :before, :check_membership, :if => lambda { self.age > 18 }
+ # end
#
def skip_callback(name, *filter_list, &block)
__update_callbacks(name, filter_list, block) do |chain, type, filters, options|