diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-07 21:07:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-07 21:07:54 +0000 |
commit | 8c8b94e7116fa478ad490bd14c09565d23097f57 (patch) | |
tree | 9e4637aa0fe498a5523c86932b87ff691ec72af6 /lib/gitlab/cycle_analytics/summary/deploy.rb | |
parent | eadb77d89f5f7d445bfd326f18873168f4719f12 (diff) | |
download | gitlab-ce-8c8b94e7116fa478ad490bd14c09565d23097f57.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/cycle_analytics/summary/deploy.rb')
-rw-r--r-- | lib/gitlab/cycle_analytics/summary/deploy.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/cycle_analytics/summary/deploy.rb b/lib/gitlab/cycle_analytics/summary/deploy.rb index 3b56dc2a7bc..0691f3cd131 100644 --- a/lib/gitlab/cycle_analytics/summary/deploy.rb +++ b/lib/gitlab/cycle_analytics/summary/deploy.rb @@ -4,12 +4,18 @@ module Gitlab module CycleAnalytics module Summary class Deploy < Base + include Gitlab::Utils::StrongMemoize + def title n_('Deploy', 'Deploys', value) end def value - @value ||= @project.deployments.where("created_at > ?", @from).count + strong_memoize(:value) do + query = @project.deployments.where("created_at >= ?", @from) + query = query.where("created_at <= ?", @to) if @to + query.count + end end end end |