# Habtm and :uniq

**URL:** <https://www.ruby-forum.com/t/habtm-and-uniq/57508>\
**Category:** Rails\
**Created:** [April 11, 2006, 4:52pm UTC](https://www.ruby-forum.com/t/habtm-and-uniq/57508 "2006-04-11T16:52:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhutter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@mhutter](https://www.ruby-forum.com/u/mhutter)\
**Post date:** [April 11, 2006, 4:52pm UTC](https://www.ruby-forum.com/t/habtm-and-uniq/57508/1 "2006-04-11T16:52:27Z")

</div>

Hi

I wonder what the state of this ticket is:

[http://dev.rubyonrails.org/ticket/2019](http://dev.rubyonrails.org/ticket/2019)

Does anyone have information regarding whether there are plans to fix  
this behaviour? It seems strange to me to force uniqueness in Ruby  
(i.e. application code) but not in the database.

For example, in activerecord/lib/active\_record/associations/  
has\_and\_belongs\_to\_many\_association.rb there is a line which reads

@reflection.options[:uniq] ? uniq(records) : records

This would be superflous if the “\<\<” operator checked for uniqueness.

I’d be grateful for any information on this topic.

Thanks,

Manuel H.
