diff options
author | Leigh Caplan <lcaplan@onehub.com> | 2010-07-21 16:46:38 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-26 09:53:42 -0700 |
commit | e56c9ef08db49653f0c63a0305d563b2514b266b (patch) | |
tree | 9c512ff5a82ac3d0e7f8041319f36dcf07fe0af9 /activesupport/lib/active_support/deprecation | |
parent | e87e3db200e5b711237da8bcdc873044a984ad90 (diff) | |
download | rails-e56c9ef08db49653f0c63a0305d563b2514b266b.tar.gz rails-e56c9ef08db49653f0c63a0305d563b2514b266b.tar.bz2 rails-e56c9ef08db49653f0c63a0305d563b2514b266b.zip |
Override new on proxy objects so that they never wrap nil or false.
Diffstat (limited to 'activesupport/lib/active_support/deprecation')
-rw-r--r-- | activesupport/lib/active_support/deprecation/proxy_wrappers.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/deprecation/proxy_wrappers.rb b/activesupport/lib/active_support/deprecation/proxy_wrappers.rb index dec56715be..b22d0a6941 100644 --- a/activesupport/lib/active_support/deprecation/proxy_wrappers.rb +++ b/activesupport/lib/active_support/deprecation/proxy_wrappers.rb @@ -3,6 +3,13 @@ require 'active_support/inflector' module ActiveSupport module Deprecation class DeprecationProxy #:nodoc: + def self.new(*args, &block) + object = args.first + + return object unless object + super + end + instance_methods.each { |m| undef_method m unless m =~ /^__|^object_id$/ } # Don't give a deprecation warning on inspect since test/unit and error |