Permalink
Browse files

updated AS:Callbacks doc for terminator option in define_callbacks me…

…thod

The change is commited at ba55276
  • Loading branch information...
1 parent 4eedb39 commit 49fd826042d2278c69a5b66eecbe896bc7908441 @yangchenyun yangchenyun committed Jun 30, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 activesupport/lib/active_support/callbacks.rb
@@ -658,10 +658,11 @@ def reset_callbacks(symbol)
#
# * <tt>:terminator</tt> - Determines when a before filter will halt the
# callback chain, preventing following callbacks from being called and
- # the event from being triggered. This is a string to be eval'd. The
- # result of the callback is available in the +result+ variable.
+ # the event from being triggered. This should be a lambda to be executed.
+ # The current object and the return result of the callback will be called
+ # with the lambda.
#
- # define_callbacks :validate, terminator: 'result == false'
+ # define_callbacks :validate, terminator: ->(target,result) { result == false },
#
# In this example, if any before validate callbacks returns +false+,
# other callbacks are not executed. Defaults to +false+, meaning no value

0 comments on commit 49fd826

Please sign in to comment.