Flowdock
method

distinct

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveRecord::QueryMethods
distinct(value = true) public

Specifies whether the records should be unique or not. For example:

User.select(:name)
# Might return two records with the same name

User.select(:name).distinct
# Returns 1 record per distinct name

User.select(:name).distinct.distinct(false)
# You can also remove the uniqueness
Show source
Register or log in to add new notes.