Permalink
Browse files

fixing activerecord tests [#4205 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 7a83abe commit 843255a763c5e68beaa3a1b0bca306c625c30797 @tenderlove tenderlove committed with jeremy Mar 17, 2010
@@ -13,6 +13,7 @@
require 'active_support/core_ext/string/behavior'
require 'active_support/core_ext/object/singleton_class'
require 'active_support/core_ext/module/delegation'
+require 'active_support/core_ext/module/remove_method'
require 'arel'
require 'active_record/errors'
@@ -27,7 +27,7 @@ def superclass_delegating_accessor(name, options = {})
# inheritance behavior, without having to store the object in an instance
# variable and look up the superclass chain manually.
def _stash_object_in_method(object, method, instance_reader = true)
- singleton_class.send(:remove_possible_method, method)
+ singleton_class.remove_possible_method(method)
singleton_class.send(:define_method, method) { object }
remove_possible_method(method)
define_method(method) { object } if instance_reader
@@ -37,7 +37,7 @@ def _superclass_delegating_accessor(name, options = {})
singleton_class.send(:define_method, "#{name}=") do |value|
_stash_object_in_method(value, name, options[:instance_reader] != false)
end
- self.send("#{name}=", nil)
+ send("#{name}=", nil)
end
end

0 comments on commit 843255a

Please sign in to comment.