提交 4e8f1ba2 编写于 作者: S Sean Griffin 提交者: GitHub

Merge pull request #26451 from kamipo/remove_target_uniq_size

Remove unnecessary `target.uniq.size` in `CollectionAssociation#size`
......@@ -219,11 +219,7 @@ def destroy(*records)
# +count_records+, which is a method descendants have to provide.
def size
if !find_target? || loaded?
if association_scope.distinct_value
target.uniq.size
else
target.size
end
target.size
elsif !association_scope.group_values.empty?
load_target.size
elsif !association_scope.distinct_value && target.is_a?(Array)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册