Forum: Ruby on Rails habtm and :uniq

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Manuel H. (Guest)
on 2006-04-11 18:52
(Received via mailing list)

I wonder what the state of this ticket is:

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.


Manuel H.
This topic is locked and can not be replied to.