lib/active_record/connection_adapters/fdbsql/schema_statements.rb
def columns_for_distinct(columns, orders)
            # Lifted from the default Postgres implementation
            order_columns = orders.map{ |s|
                # Convert Arel node to string
                s = s.to_sql unless s.is_a?(String)
                # Remove any ASC/DESC modifiers
                s.gsub(/\s+(ASC|DESC)\s*(NULLS\s+(FIRST|LAST)\s*)?/i, '')
              }.reject(&:blank?).map.with_index { |column, i| "#{column} AS alias_#{i}" }

            [super, *order_columns].join(', ')
          end
# Given a set of columns and an ORDER BY clause, returns the columns for a SELECT DISTINCT.
#
# FDB SQL requires order columns appear in the SELECT.
Given a set of columns and an ORDER BY clause, returns the columns for a SELECT DISTINCT.
FDB SQL requires order columns appear in the SELECT.
Given a set of columns and an ORDER BY clause returns the columns for a SELECT DISTINCT . FDB SQL requires order columns appear in the SELECT .
def columns_for_distinct(columns, orders)
            order_columns = orders.map{ |s|
                s = s.to_sql unless s.is_a?(String)
                s.gsub(/\s+(ASC|DESC)\s*(NULLS\s+(FIRST|LAST)\s*)?/i, '')
              }.reject(&:blank?).map.with_index { |column, i| "#{column} AS alias_#{i}" }
            [super, *order_columns].join(', ')
          end
def columns_for_distinct ( columns , orders ) order_columns = orders . map { | s | s = s . to_sql unless s . is_a? ( String ) s . gsub ( / \s +(ASC|DESC) \s *(NULLS \s +(FIRST|LAST) \s *)? /i , '' ) } . reject ( & :blank? ) . map . with_index { | column , i | "#{column} AS alias_#{i}" } [ super , * order_columns ] . join ( ', ' ) end
Given a set of columns and an ORDER BY clause, returns the columns for a SELECT DISTINCT.
Given a set of columns and an ORDER BY clause returns the columns for a SELECT DISTINCT .
# Lifted from the default Postgres implementation # Convert Arel node to string # Remove any ASC/DESC modifiers
columns
orders