Skip to content

Commit

Permalink
Override new on proxy objects so that they never wrap nil or false.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leigh Caplan authored and tenderlove committed Jul 26, 2010
1 parent e87e3db commit e56c9ef
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -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
Expand Down

0 comments on commit e56c9ef

Please sign in to comment.