method

expand

rails latest stable - Class: ActiveRecord::PredicateBuilder

Method deprecated or moved

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

expand(column, value)
public

No documentation available.

# File activerecord/lib/active_record/relation/predicate_builder.rb, line 39
    def expand(column, value)
      # Find the foreign key when using queries such as:
      # Post.where(author: author)
      #
      # For polymorphic relationships, find the foreign key and type:
      # PriceEstimate.where(estimate_of: treasure)
      value = AssociationQueryHandler.value_for(table, column, value) if table.associated_with?(column)
      build(table.arel_attribute(column), value)
    end