diff options
author | Nick Thomas <nick@gitlab.com> | 2019-08-19 14:45:24 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-08-19 14:45:24 +0000 |
commit | 3028cd687a256b593272248e50a3174811594e64 (patch) | |
tree | 5777662f6eae8e530912a8fad12bd23d2bc748fc /lib | |
parent | 4d4e88df01554336daf245a68653b80ca00989a5 (diff) | |
parent | f53112de5931144ac74819f87c227f06e115ba58 (diff) | |
download | gitlab-ce-3028cd687a256b593272248e50a3174811594e64.tar.gz |
Merge branch '39-count-unique-users-for-more-accurate-smau-reporting' into 'master'
Allow UsageData.count to use count_by:
See merge request gitlab-org/gitlab-ce!30770
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/usage_data.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index 1542905d2ce..353298e67b3 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -188,8 +188,8 @@ module Gitlab {} # augmented in EE end - def count(relation, fallback: -1) - relation.count + def count(relation, count_by: nil, fallback: -1) + count_by ? relation.count(count_by) : relation.count rescue ActiveRecord::StatementInvalid fallback end |