method

limited_ids_for

Importance_0
v4.2.9 - 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 394
    def limited_ids_for(relation)
      values = @klass.connection.columns_for_distinct(
        "#{quoted_table_name}.#{quoted_primary_key}", relation.order_values)

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

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