diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-12-20 21:28:31 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-12-20 21:28:31 +0000 |
commit | 01452feff1ab4e06ed41cd093bb8a140cd6b2cb6 (patch) | |
tree | fac71a0165bcfc38ff5ca0b9a0f715e1bca8e17e /activesupport/lib | |
parent | a8b53f1dbbfde4385d842e6f4b667bf7db638409 (diff) | |
download | rails-01452feff1ab4e06ed41cd093bb8a140cd6b2cb6.tar.gz rails-01452feff1ab4e06ed41cd093bb8a140cd6b2cb6.tar.bz2 rails-01452feff1ab4e06ed41cd093bb8a140cd6b2cb6.zip |
DeprecatedInstanceVariable#inspect doesn't warn since test/unit, error logs, and others use it for diagnostics.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5763 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/deprecation.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb index 76db7b5a56..3c1ceafcff 100644 --- a/activesupport/lib/active_support/deprecation.rb +++ b/activesupport/lib/active_support/deprecation.rb @@ -143,7 +143,8 @@ module ActiveSupport end end - # Stand-in for @request, @attributes, etc. + # Stand-in for @request, @attributes, @params, etc which emits deprecation + # warnings on any method call (except #inspect). class DeprecatedInstanceVariableProxy instance_methods.each { |m| undef_method m unless m =~ /^__/ } @@ -151,6 +152,12 @@ module ActiveSupport @instance, @method, @var = instance, method, var end + # Don't give a deprecation warning on inspect since test/unit and error + # logs rely on it for diagnostics. + def inspect + target.inspect + end + private def method_missing(called, *args, &block) warn caller, called, args |