method

limited_ids_for

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: ActiveRecord::FinderMethods
limited_ids_for(relation) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 404
      def limited_ids_for(relation)
        values = @klass.connection.columns_for_distinct(
          connection.column_name_from_arel_node(arel_attribute(primary_key)),
          relation.order_values
        )

        relation = relation.except(:select).select(values).distinct!

        id_rows = skip_query_cache_if_necessary { @klass.connection.select_all(relation.arel, "SQL") }
        id_rows.map { |row| row[primary_key] }
      end
Register or log in to add new notes.