debian-mirror-gitlab/lib/gitlab/grafana_embed_usage_data.rb

17 lines
474 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# frozen_string_literal: true
module Gitlab
class GrafanaEmbedUsageData
class << self
def issue_count
# rubocop:disable CodeReuse/ActiveRecord
Issue.joins('JOIN grafana_integrations USING (project_id)')
.where("issues.description LIKE '%' || grafana_integrations.grafana_url || '%'")
.where(grafana_integrations: { enabled: true })
.count
# rubocop:enable CodeReuse/ActiveRecord
end
end
end
end