Welcome to mirror list, hosted at ThFree Co, Russian Federation.

deploy.rb « summary « cycle_analytics « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8544ea1a91e59a3f65700531dea5df9ebc093417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

module Gitlab
  module CycleAnalytics
    module Summary
      class Deploy < Base
        def title
          n_('Deploy', 'Deploys', value)
        end

        def value
          @value ||= Value::PrettyNumeric.new(deployments_count)
        end

        private

        def deployments_count
          query = @project.deployments.success.where("created_at >= ?", @from)
          query = query.where("created_at <= ?", @to) if @to
          query.count
        end
      end
    end
  end
end