From 5b9d882302684a730875df512b864a2a498a4421 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 17 Mar 2010 10:04:49 -0700 Subject: [PATCH] fixing activerecord tests [#4205 state:resolved] --- activerecord/lib/active_record/base.rb | 1 + .../core_ext/class/delegating_attributes.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 3d4172f..6999d41 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -13,6 +13,7 @@ require 'active_support/core_ext/hash/slice' 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' diff --git a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb index df4954e..9b2dc21 100644 --- a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +++ b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb @@ -27,7 +27,7 @@ private # 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 @@ private 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 -- 1.6.6