aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/callbacks.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-02-07 12:24:46 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-02-07 12:24:46 -0300
commit9e98f3f7e61dfce0a48948c8d296400af8bfaf21 (patch)
tree0df238b7868ce254ea262181d8dde32ad224d06e /activesupport/lib/active_support/callbacks.rb
parent3a25cdca3e0d29ee2040931d0cb6c275d612dffe (diff)
downloadrails-9e98f3f7e61dfce0a48948c8d296400af8bfaf21.tar.gz
rails-9e98f3f7e61dfce0a48948c8d296400af8bfaf21.tar.bz2
rails-9e98f3f7e61dfce0a48948c8d296400af8bfaf21.zip
Deprecate halt_and_display_warning_on_return_false
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
-rw-r--r--activesupport/lib/active_support/callbacks.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 2449cb06d8..480291c346 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -69,11 +69,18 @@ module ActiveSupport
CALLBACK_FILTER_TYPES = [:before, :after, :around]
- # If true, Active Record and Active Model callbacks returning +false+ will
- # halt the entire callback chain and display a deprecation message.
- # If false, callback chains will only be halted by calling +throw :abort+.
- # Defaults to +true+.
- mattr_accessor(:halt_and_display_warning_on_return_false, instance_writer: false) { true }
+ def self.halt_and_display_warning_on_return_false=(value)
+
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
+ .halt_and_display_warning_on_return_false= is deprecated and will be removed in Rails 5.2.
+ MSG
+ end
+
+ def self.halt_and_display_warning_on_return_false
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
+ .halt_and_display_warning_on_return_false is deprecated and will be removed in Rails 5.2.
+ MSG
+ end
# Runs the callbacks for the given event.
#