Skip to content
This repository
Browse code

Ruby 1.9 compat: define __setobj__ for Delegator

  • Loading branch information...
commit 828914a062d3fd6cd51ebd3881acea11eede45cc 1 parent d2212c1
Jeremy Kemper authored May 10, 2008
8  activesupport/lib/active_support/deprecation.rb
@@ -178,15 +178,19 @@ def warn(callstack, called, args)
178 178
 
179 179
     class DeprecatedInstanceVariable < Delegator #:nodoc:
180 180
       def initialize(value, method)
181  
-        super(value)
182 181
         @method = method
183  
-        @value = value
  182
+        super(value)
  183
+        __setobj__(value)
184 184
       end
185 185
 
186 186
       def __getobj__
187 187
         ActiveSupport::Deprecation.warn("Instance variable @#{@method} is deprecated! Call instance method #{@method} instead.")
188 188
         @value
189 189
       end
  190
+
  191
+      def __setobj__(value)
  192
+        @value = value
  193
+      end
190 194
     end
191 195
 
192 196
   end

0 notes on commit 828914a

Please sign in to comment.
Something went wrong with that request. Please try again.