aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/callbacks.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-05-10 10:53:46 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-05-10 10:53:46 -0700
commit5bc4740dec7ec9846915f7af459056d486b9c89d (patch)
tree58d0eda2d9974ad0cffcbce6982e7f7985409395 /activesupport/lib/active_support/callbacks.rb
parent355169012011d9ef565ed75ce8b734346fe8c00c (diff)
downloadrails-5bc4740dec7ec9846915f7af459056d486b9c89d.tar.gz
rails-5bc4740dec7ec9846915f7af459056d486b9c89d.tar.bz2
rails-5bc4740dec7ec9846915f7af459056d486b9c89d.zip
fixing activemodel tests
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
-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|