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:
parent
e87e3db200
commit
e56c9ef08d
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue