Method: ActiveRecord::ConnectionAdapters::SchemaStatements#columns_for_distinct

Defined in:
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb

#columns_for_distinct(columns, orders) ⇒ Object

Given a set of columns and an ORDER BY clause, returns the columns for a SELECT DISTINCT. PostgreSQL, MySQL, and Oracle override this for custom DISTINCT syntax - they require the order columns appear in the SELECT.

columns_for_distinct("posts.id", ["posts.created_at desc"])


1150
1151
1152
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb', line 1150

def columns_for_distinct(columns, orders) # :nodoc:
  columns
end