From bb78af73ab7e86fd9662e8810e346b082a1ae193 Mon Sep 17 00:00:00 2001 From: claudiob Date: Sun, 14 Dec 2014 22:10:15 -0800 Subject: Deprecate `false` as the way to halt AR callbacks Before this commit, returning `false` in an ActiveRecord `before_` callback such as `before_create` would halt the callback chain. After this commit, the behavior is deprecated: will still work until the next release of Rails but will also display a deprecation warning. The preferred way to halt a callback chain is to explicitly `throw(:abort)`. --- activerecord/test/cases/attribute_test.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/test/cases/attribute_test.rb') diff --git a/activerecord/test/cases/attribute_test.rb b/activerecord/test/cases/attribute_test.rb index 7b325abf1d..39a976fcc8 100644 --- a/activerecord/test/cases/attribute_test.rb +++ b/activerecord/test/cases/attribute_test.rb @@ -5,6 +5,7 @@ module ActiveRecord class AttributeTest < ActiveRecord::TestCase setup do @type = Minitest::Mock.new + @type.expect(:==, false, [false]) end teardown do -- cgit v1.2.3