提交 c4f8c45b 编写于 作者: K Kasper Timm Hansen 提交者: GitHub

Merge pull request #26076 from yui-knk/privatize_expand

`ActiveRecord::PredicateBuilder#expand` to be private
......@@ -36,16 +36,6 @@ def create_binds(attributes)
create_binds_for_hash(attributes)
end
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
def self.references(attributes)
attributes.map do |key, value|
if value.is_a?(Hash)
......@@ -130,6 +120,16 @@ def create_binds_for_hash(attributes)
private
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
def associated_predicate_builder(association_name)
self.class.new(table.associated_table(association_name))
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册