Permalink
Browse files

Override new on proxy objects so that they never wrap nil or false.

  • Loading branch information...
1 parent e87e3db commit e56c9ef08db49653f0c63a0305d563b2514b266b @texel texel committed with tenderlove Jul 21, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 activesupport/lib/active_support/deprecation/proxy_wrappers.rb
@@ -3,6 +3,13 @@
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

0 comments on commit e56c9ef

Please sign in to comment.