diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb index 7613652c71b30a6e7f6dea9d23329c01e20c01bc..e01ec92660c9c146a4d3c0c77ab4467f786a6247 100644 --- a/activesupport/lib/active_support/deprecation.rb +++ b/activesupport/lib/active_support/deprecation.rb @@ -178,15 +178,19 @@ def warn(callstack, called, args) 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