提交 9f357992 编写于 作者: E Emilio Tagua 提交者: Aaron Patterson

Refactor && simplify count_records.

上级 e2bad8a2
......@@ -42,11 +42,7 @@ def count_records
# documented side-effect of the method that may avoid an extra SELECT.
@target ||= [] and loaded if count == 0
if @reflection.options[:limit]
count = [ @reflection.options[:limit], count ].min
end
count
@reflection.options[:limit] ? [@reflection.options[:limit], count].min : count
end
def has_cached_counter?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册