1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Leigh Caplan 2010-07-21 16:46:38 -07:00 committed by Aaron Patterson
parent e87e3db200
commit e56c9ef08d

View file

@ -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