diff options
author | yui-knk <spiketeika@gmail.com> | 2015-12-15 21:12:16 +0900 |
---|---|---|
committer | Yuichiro Kaneko <kaneko.yuichiro@moneyforward.co.jp> | 2015-12-16 19:56:20 +0900 |
commit | 21f4017fd904532ebe4964481567d69636a711cf (patch) | |
tree | b8e28d0a5b39f9db1b424df4d0821cf34aa70352 /activesupport/lib | |
parent | 2de7385cef62ad12cef5bcfe1de18c4662072344 (diff) | |
download | rails-21f4017fd904532ebe4964481567d69636a711cf.tar.gz rails-21f4017fd904532ebe4964481567d69636a711cf.tar.bz2 rails-21f4017fd904532ebe4964481567d69636a711cf.zip |
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+. # |