aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeigh Caplan <lcaplan@onehub.com>2010-07-21 16:46:38 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-26 09:53:42 -0700
commite56c9ef08db49653f0c63a0305d563b2514b266b (patch)
tree9c512ff5a82ac3d0e7f8041319f36dcf07fe0af9
parente87e3db200e5b711237da8bcdc873044a984ad90 (diff)
downloadrails-e56c9ef08db49653f0c63a0305d563b2514b266b.tar.gz
rails-e56c9ef08db49653f0c63a0305d563b2514b266b.tar.bz2
rails-e56c9ef08db49653f0c63a0305d563b2514b266b.zip
Override new on proxy objects so that they never wrap nil or false.
-rw-r--r--activesupport/lib/active_support/deprecation/proxy_wrappers.rb7
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