Removed ON() on distinct comment

This commit is contained in:
Sebastian Martinez
2011-04-22 12:14:23 -03:00
parent 6822f39f67
commit 20002850b3

View File

@@ -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 * ', '