diff options
author | Ernie Miller <ernie@metautonomo.us> | 2008-08-02 11:47:05 -0400 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-08-08 15:19:08 +0200 |
commit | 7f6e7ba1f7e8735f1c3f30ba125b5432f00d2a70 (patch) | |
tree | 6ef0f774359e80d8c20dd4fd244edab61bd00cec /activerecord/lib/active_record/associations/association_collection.rb | |
parent | 06e4eb49eaabde76e38e4f275619fe2df51f1e0a (diff) | |
download | rails-7f6e7ba1f7e8735f1c3f30ba125b5432f00d2a70.tar.gz rails-7f6e7ba1f7e8735f1c3f30ba125b5432f00d2a70.tar.bz2 rails-7f6e7ba1f7e8735f1c3f30ba125b5432f00d2a70.zip |
Fixed AssociationCollection#<< resulting in unexpected values in @target when :uniq => true
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/lib/active_record/associations/association_collection.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index a28be9eed1..9061037b39 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -344,7 +344,7 @@ module ActiveRecord callback(:before_add, record) yield(record) if block_given? @target ||= [] unless loaded? - @target << record + @target << record unless @reflection.options[:uniq] && @target.include?(record) callback(:after_add, record) record end |