From 640ee5b68d1078fc164bd4e10c019f284ad9b760 Mon Sep 17 00:00:00 2001 From: wycats Date: Wed, 17 Mar 2010 00:53:48 -0700 Subject: Fix some more warnings on 1.9 --- .../lib/active_support/core_ext/class/delegating_attributes.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activesupport/lib/active_support/core_ext/class/delegating_attributes.rb') 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 b5785bdcd3..df4954e67a 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,9 @@ 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.send(:define_method, method) { object } + remove_possible_method(method) define_method(method) { object } if instance_reader end -- cgit v1.2.3 From 843255a763c5e68beaa3a1b0bca306c625c30797 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 17 Mar 2010 10:04:49 -0700 Subject: fixing activerecord tests [#4205 state:resolved] Signed-off-by: Jeremy Kemper --- .../lib/active_support/core_ext/class/delegating_attributes.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/class/delegating_attributes.rb') 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 -- cgit v1.2.3 From 067b350301279f608a369a39aff9b6f5a22357aa Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 17 Mar 2010 10:11:38 -0700 Subject: Move require closer to home --- activesupport/lib/active_support/core_ext/class/delegating_attributes.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activesupport/lib/active_support/core_ext/class/delegating_attributes.rb') 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 9b2dc21d87..12caa76c98 100644 --- a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +++ b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb @@ -1,6 +1,7 @@ require 'active_support/core_ext/object/blank' require 'active_support/core_ext/array/extract_options' require 'active_support/core_ext/object/singleton_class' +require 'active_support/core_ext/module/remove_method' class Class def superclass_delegating_accessor(name, options = {}) -- cgit v1.2.3