Permalink
Browse files

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

  • Loading branch information...
1 parent ae63d5c commit a9ef2fd56c3f2a20e2b6e3f9b607efa0fc03271c @texel texel committed with tenderlove Jul 22, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 activesupport/lib/active_support/deprecation.rb
@@ -120,6 +120,13 @@ def deprecation_horizon
end
class DeprecationProxy #:nodoc:
+ def self.new(*args, &block)
+ object = args.first
+
+ return object unless object
+ super
+ end
+
silence_warnings do
instance_methods.each { |m| undef_method m unless m =~ /^__/ }
end

0 comments on commit a9ef2fd

Please sign in to comment.