From 6c5b734e6a529284bab4c7bdca770d390b8b9084 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 8 Dec 2010 15:37:13 -0800 Subject: removing method to prevent warnings --- activerecord/lib/active_record/associations.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 4711522b00..cdc8f25119 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1564,6 +1564,10 @@ module ActiveRecord end end.compact.join + if method_defined?(:"#{reflection.primary_key_name}=") + undef_method :"#{reflection.primary_key_name}=" + end + class_eval <<-FILE, __FILE__, __LINE__ + 1 def #{reflection.primary_key_name}=(new_id) write_attribute :#{reflection.primary_key_name}, new_id -- cgit v1.2.3