diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2015-12-16 13:54:02 -0200 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2015-12-16 13:54:02 -0200 |
commit | b7a7e82207efd24d685fc1325fb523f047ca2ce1 (patch) | |
tree | 4fdaf223271dcb9eed500ed184365bdc4b159629 /activesupport/lib | |
parent | cf01e4e797e0c9162686babbb670f84481305d98 (diff) | |
parent | 21f4017fd904532ebe4964481567d69636a711cf (diff) | |
download | rails-b7a7e82207efd24d685fc1325fb523f047ca2ce1.tar.gz rails-b7a7e82207efd24d685fc1325fb523f047ca2ce1.tar.bz2 rails-b7a7e82207efd24d685fc1325fb523f047ca2ce1.zip |
Merge pull request #22598 from yui-knk/deprecate_string_callback
Deprecate passing string to define callback.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index d43fde03a9..bf560ec1fa 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -295,6 +295,13 @@ 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. + MSG + end + new chain.name, filter, kind, options, chain.config end @@ -575,7 +582,7 @@ module ActiveSupport # set_callback :save, :before_meth # # 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; or as an + # 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+. # |