diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-05-10 10:47:06 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-05-12 13:24:32 -0700 |
commit | 828914a062d3fd6cd51ebd3881acea11eede45cc (patch) | |
tree | e57972e4bc72dcf0817c028f67b6afb1d47f3bd4 | |
parent | d2212c1601dcd67e72e9d52f98347d3285fd7134 (diff) | |
download | rails-828914a062d3fd6cd51ebd3881acea11eede45cc.tar.gz rails-828914a062d3fd6cd51ebd3881acea11eede45cc.tar.bz2 rails-828914a062d3fd6cd51ebd3881acea11eede45cc.zip |
Ruby 1.9 compat: define __setobj__ for Delegator
-rw-r--r-- | activesupport/lib/active_support/deprecation.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb index 7613652c71..e01ec92660 100644 --- a/activesupport/lib/active_support/deprecation.rb +++ b/activesupport/lib/active_support/deprecation.rb @@ -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 |