aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-03-17 10:04:49 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-17 10:09:14 -0700
commit843255a763c5e68beaa3a1b0bca306c625c30797 (patch)
tree4eb5f258d9ffde277ea69cc54be44a8df2b3aa37
parent7a83abe52fd982c2b34e8026f3ae34664ad60bc6 (diff)
downloadrails-843255a763c5e68beaa3a1b0bca306c625c30797.tar.gz
rails-843255a763c5e68beaa3a1b0bca306c625c30797.tar.bz2
rails-843255a763c5e68beaa3a1b0bca306c625c30797.zip
fixing activerecord tests [#4205 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
-rwxr-xr-xactiverecord/lib/active_record/base.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/class/delegating_attributes.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 3d4172f368..6999d4113d 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 df4954e67a..9b2dc21d87 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