instance method build_count_subquery?

Ruby on Rails 8.1.2

Since v7.2.3 Private — implementation detail, not part of the public API

Available in: v7.2.3 v8.0.4 v8.1.2

Signature

build_count_subquery?(operation, column_name, distinct)

No documentation comment.

Parameters

operation req
column_name req
distinct req
Source
# 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

Defined in activerecord/lib/active_record/relation/calculations.rb line 668 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Calculations

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close