diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-08 15:37:13 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-08 15:37:13 -0800 |
commit | 6c5b734e6a529284bab4c7bdca770d390b8b9084 (patch) | |
tree | b186bd450563dbc0794c15765681fe6e33950741 | |
parent | 7ecee054a322e214e4f285b1a8327751bd79a418 (diff) | |
download | rails-6c5b734e6a529284bab4c7bdca770d390b8b9084.tar.gz rails-6c5b734e6a529284bab4c7bdca770d390b8b9084.tar.bz2 rails-6c5b734e6a529284bab4c7bdca770d390b8b9084.zip |
removing method to prevent warnings
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |