method

build_count_subquery?

build_count_subquery?(operation, column_name, distinct)
private

No documentation available.

# File activerecord/lib/active_record/relation/calculations.rb, line 668
      def build_count_subquery?(operation, column_name, distinct)
        # SQLite and older MySQL does not support `COUNT DISTINCT` with `*` or
        # multiple columns, so we need to use subquery for this.
        operation == "count" &&
          (((column_name == :all || select_values.many?) && distinct) || has_limit_or_offset?)
      end