method

select_for_count

select_for_count()
private

No documentation available.

# File activerecord/lib/active_record/relation/calculations.rb, line 637
      def select_for_count
        if select_values.present?
          return select_values.first if select_values.one?

          select_values.map do |field|
            column = arel_column(field.to_s) do |attr_name|
              Arel.sql(attr_name)
            end

            if column.is_a?(Arel::Nodes::SqlLiteral)
              column
            else
              "#{adapter_class.quote_table_name(column.relation.name)}.#{adapter_class.quote_column_name(column.name)}"
            end
          end.join(", ")
        else
          :all
        end
      end