mirror of
https://github.com/github/rails.git
synced 2026-01-29 00:08:15 -05:00
Ruby 1.9 compat: define __setobj__ for Delegator
This commit is contained in:
@@ -178,15 +178,19 @@ module ActiveSupport
|
||||
|
||||
class DeprecatedInstanceVariable < Delegator #:nodoc:
|
||||
def initialize(value, method)
|
||||
super(value)
|
||||
@method = method
|
||||
@value = value
|
||||
super(value)
|
||||
__setobj__(value)
|
||||
end
|
||||
|
||||
def __getobj__
|
||||
ActiveSupport::Deprecation.warn("Instance variable @#{@method} is deprecated! Call instance method #{@method} instead.")
|
||||
@value
|
||||
end
|
||||
|
||||
def __setobj__(value)
|
||||
@value = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user