提交 d108672d 编写于 作者: Y Yves Senn

remove string based terminators for `ActiveSupport::Callbacks`.

上级 efeb0390
* Remove deprecated string based terminators for y`ActiveSupport::Callbacks`.
*Yves Senn*
* Remove deprecated `String#encoding_aware?` core extensions (`core_ext/string/encoding`).
*Arun Agrawal*
......
......@@ -718,12 +718,6 @@ def reset_callbacks(name)
# would call <tt>Audit#save</tt>.
def define_callbacks(*names)
options = names.extract_options!
if options.key?(:terminator) && String === options[:terminator]
ActiveSupport::Deprecation.warn "String based terminators are deprecated, please use a lambda"
value = options[:terminator]
line = class_eval "lambda { |result| #{value} }", __FILE__, __LINE__
options[:terminator] = lambda { |target, result| target.instance_exec(result, &line) }
end
names.each do |name|
class_attribute "_#{name}_callbacks"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册