aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/callbacks.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 141c246396..7c71524ffe 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -351,7 +351,8 @@ module ActiveSupport
def compile
callbacks = lambda { |env|
- env.value = env.run_block.call if env.run_block && !env.halted
+ block = env.run_block
+ env.value = !env.halted && (!block || block.call)
env
}
reverse_each do |callback|