method
expand
rails latest stable - Class:
ActiveRecord::PredicateBuilder
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