method
columns_for_distinct
v6.1.7.7 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::SchemaStatements
columns_for_distinct(columns, orders)public
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"])