提交 66a6a6b4 编写于 作者: A Aaron Patterson

eliminate single use method

上级 158197b9
......@@ -243,7 +243,9 @@ def raise_record_not_found_exception!(ids, result_size, expected_size) #:nodoc:
def find_with_associations
join_dependency = construct_join_dependency
relation = except :select
relation = construct_relation_for_association_find(join_dependency, relation)
relation = relation.select(join_dependency.columns)
relation = apply_join_dependency(relation, join_dependency)
if block_given?
yield relation
else
......@@ -265,11 +267,6 @@ def construct_relation_for_association_calculations
apply_join_dependency(self, construct_join_dependency(arel.froms.first))
end
def construct_relation_for_association_find(join_dependency, relation = self)
relation = relation.select(join_dependency.columns)
apply_join_dependency(relation, join_dependency)
end
def apply_join_dependency(relation, join_dependency)
relation = relation.except(:includes, :eager_load, :preload)
relation = relation.joins join_dependency
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册