method

value_for

rails latest stable - Class: ActiveRecord::PredicateBuilder::AssociationQueryHandler

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.1.7) is shown here.

value_for(table, column, value)
public

No documentation available.

# File activerecord/lib/active_record/relation/predicate_builder/association_query_handler.rb, line 4
      def self.value_for(table, column, value)
        associated_table = table.associated_table(column)
        klass = if associated_table.polymorphic_association? && ::Array === value && value.first.is_a?(Base)
          PolymorphicArrayValue
        else
          AssociationQueryValue
        end

        klass.new(associated_table, value)
      end