mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Removed ON() on distinct comment
This commit is contained in:
@@ -933,7 +933,7 @@ module ActiveRecord
|
||||
order_columns.delete_if { |c| c.blank? }
|
||||
order_columns = order_columns.zip((0...order_columns.size).to_a).map { |s,i| "#{s} AS alias_#{i}" }
|
||||
|
||||
# Return a DISTINCT ON() clause that's distinct on the columns we want but includes
|
||||
# Return a DISTINCT clause that's distinct on the columns we want but includes
|
||||
# all the required columns for the ORDER BY to work properly.
|
||||
sql = "DISTINCT ON (#{columns}) #{columns}, "
|
||||
sql << order_columns * ', '
|
||||
|
||||
Reference in New Issue
Block a user