提交 2ce49e7d 编写于 作者: J Jeremy Kemper

separate warn method for easier localization override

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4720 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 0a44c858
......@@ -81,8 +81,12 @@ def initialize(instance, method, var = "@#{method}")
end
private
def warn(callstack, called, args)
ActiveSupport::Deprecation.warn("#{@var} is deprecated! Call #{@method}.#{called} instead of #{@var}.#{called}. Args: #{args.inspect}", callstack)
end
def method_missing(called, *args, &block)
ActiveSupport::Deprecation.warn("#{@var} is deprecated! Call #{@method}.#{called} instead of #{@var}.#{called}. Args: #{args.inspect}", caller)
warn caller, called, args
@instance.__send__(@method).__send__(called, *args, &block)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册