Sha256: b1f2b58d7680c7018e5eb623d336ea8b06ac1c2b4ea710c0ec29839210b0dd92
Contents?: true
Size: 631 Bytes
Versions: 14
Compression:
Stored size: 631 Bytes
Contents
# frozen_string_literal: true module ActiveRecord class PredicateBuilder class RelationHandler # :nodoc: def call(attribute, value) if value.eager_loading? value = value.send(:apply_join_dependency) end if value.select_values.empty? model = value.model if model.composite_primary_key? raise ArgumentError, "Cannot map composite primary key #{model.primary_key} to #{attribute.name}" else value = value.select(value.table[model.primary_key]) end end attribute.in(value.arel) end end end end
Version data entries
14 entries across 14 versions & 2 rubygems