New in Rails: has_many :through gets :uniq
Posted by marcel May 08, 2006 @ 08:00 PM
Changset 4325 adds the :uniq option to has_many :through. Josh Susser, ActiveRecord associations guru, offers a nice write up of what it means for has_many :through to have :uniq.
You haven’t subscribed to Josh’s RSS feed yet?

Why :uniq rather than :unique ?
Because has_and_belongs_to_many already had a :uniq option named after Ruby’s Array#uniq. Perhaps :distinct is better.
I like using the :uniq option name, as it is the same as the habtm feature and I think it makes sense for Ruby programmers. I’d keep the :distinct name in reserve for an option that uses the SQL DISTINCT feature to remove duplicates (I can dream, heh).
Just a note: Josh’s “RSS feed” is actually an ATOM feed :)
I would if I could but I’m stuck with RSS in ATOM, guess it makes the Winer happy though lol.