aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-06-03 21:16:50 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-06-03 21:16:50 +0000
commit16716090632d499eb6bfc8afdea2784eb6f5963d (patch)
treef179381121e6acc84892191d5c006f809cf31585 /activerecord/lib/active_record/associations
parent01a52dd1ad51034b10a8386db7b1aae83f32a59d (diff)
downloadrails-16716090632d499eb6bfc8afdea2784eb6f5963d.tar.gz
rails-16716090632d499eb6bfc8afdea2784eb6f5963d.tar.bz2
rails-16716090632d499eb6bfc8afdea2784eb6f5963d.zip
Fixed that has_many.create ended up with duplicate objects (closes #5250) [daniel@nouvelles-solutions.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index 660e005348..d00ac96540 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -114,7 +114,7 @@ module ActiveRecord
begin
if !loaded?
if @target.is_a?(Array) && @target.any?
- @target = find_target + @target
+ @target = (find_target + @target).uniq
else
@target = find_target
end