method

call

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: RelationHandler
call(attribute, value) public

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/predicate_builder/relation_handler.rb, line 6
      def call(attribute, value)
        if value.eager_loading?
          value = value.send(:apply_join_dependency)
        end

        if value.select_values.empty?
          if value.klass.composite_primary_key?
            raise ArgumentError, "Cannot map composite primary key #{value.klass.primary_key} to #{attribute.name}"
          else
            value = value.select(value.table[value.klass.primary_key])
          end
        end

        attribute.in(value.arel)
      end
Register or log in to add new notes.