aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-03-17 13:30:17 -0700
committerwycats <wycats@gmail.com>2010-03-17 13:56:33 -0700
commitb652aa81216f718f27ba257238d4c27dd54863b2 (patch)
tree6ef65a5e933cdfe1e4e1777c8b4e1a50ebf34515 /activerecord/lib
parentdb2d96a6ba9c8d6d07121853955abe46af350f87 (diff)
downloadrails-b652aa81216f718f27ba257238d4c27dd54863b2.tar.gz
rails-b652aa81216f718f27ba257238d4c27dd54863b2.tar.bz2
rails-b652aa81216f718f27ba257238d4c27dd54863b2.zip
cleaning up a bunch of method already defined warnings [#4209 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index bc491c367f..76ec7eb681 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -244,6 +244,9 @@ module ActiveRecord
# assign_nested_attributes_for_one_to_one_association(:pirate, attributes)
# end
class_eval <<-eoruby, __FILE__, __LINE__ + 1
+ if method_defined?(:#{association_name}_attributes=)
+ remove_method(:#{association_name}_attributes=)
+ end
def #{association_name}_attributes=(attributes)
assign_nested_attributes_for_#{type}_association(:#{association_name}, attributes)
end