diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-01-08 19:45:58 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-02-04 20:48:29 +0900 |
commit | f8d3fed1679b487485e32b52b15fe154efe0f10c (patch) | |
tree | f84c8c05beff0e86e00aca4357aa107e6807854d /activesupport/lib | |
parent | d13bc5df902a2c82c3096b627830be97acbedf50 (diff) | |
download | rails-f8d3fed1679b487485e32b52b15fe154efe0f10c.tar.gz rails-f8d3fed1679b487485e32b52b15fe154efe0f10c.tar.bz2 rails-f8d3fed1679b487485e32b52b15fe154efe0f10c.zip |
Remove deprecated passing string to define callback
And raise `ArgumentError` when passing string to define callback.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index e6c79f2a38..16455c8b93 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -286,9 +286,8 @@ module ActiveSupport class Callback #:nodoc:# def self.build(chain, filter, kind, options) if filter.is_a?(String) - ActiveSupport::Deprecation.warn(<<-MSG.squish) - Passing string to define callback is deprecated and will be removed - in Rails 5.1 without replacement. + raise ArgumentError, <<-MSG.squish + Passing string to define callback is not supported. Use proc instead. MSG end @@ -643,9 +642,8 @@ module ActiveSupport # set_callback :save, :before_method # # The callback can be specified as a symbol naming an instance method; as a - # proc, lambda, or block; as a string to be instance evaluated(deprecated); or as an - # object that responds to a certain method determined by the <tt>:scope</tt> - # argument to +define_callbacks+. + # proc, lambda, or block; or as an object that responds to a certain method + # determined by the <tt>:scope</tt> argument to +define_callbacks+. # # If a proc, lambda, or block is given, its body is evaluated in the context # of the current object. It can also optionally accept the current object as |