instance method find_some_ordered

Ruby on Rails 5.2.8.1

Since v5.2.8.1 Private

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

find_some_ordered(ids)

No documentation comment.

Parameters

ids req
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 485
      def find_some_ordered(ids)
        ids = ids.slice(offset_value || 0, limit_value || ids.size) || []

        result = except(:limit, :offset).where(primary_key => ids).records

        if result.size == ids.size
          pk_type = @klass.type_for_attribute(primary_key)

          records_by_id = result.index_by(&:id)
          ids.map { |id| records_by_id.fetch(pk_type.cast(id)) }
        else
          raise_record_not_found_exception!(ids, result.size, ids.size)
        end
      end

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

Defined in ActiveRecord::FinderMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close