I think "uniq" is more Rails-y than select("distinct(categories.id)")