提交 7f8d4d3c 编写于 作者: P Pratik Naik

Get rid of Base#merge_includes

上级 e17b23db
......@@ -1583,11 +1583,6 @@ def construct_join(joins)
end
end
# Merges includes so that the result is a valid +include+
def merge_includes(first, second)
(Array.wrap(first) + Array.wrap(second)).uniq
end
def build_association_joins(joins)
join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, joins, nil)
relation = active_relation.table
......
......@@ -155,7 +155,8 @@ def construct_calculation_arel(options = {}, merge_with_relation = nil)
validate_calculation_options(options)
options = options.except(:distinct)
includes = merge_includes(merge_with_relation ? merge_with_relation.includes_values : [], options[:include])
merge_with_includes = merge_with_relation ? merge_with_relation.includes_values : []
includes = (merge_with_includes + Array.wrap(options[:include])).uniq
if includes.any?
merge_with_joins = merge_with_relation ? merge_with_relation.joins_values : []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册