summaryrefslogtreecommitdiff
path: root/app/models/prometheus_metric.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-02 18:10:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-02 18:10:40 +0000
commit4e06ca9e7d67aee59d691a363dabba46d53d34ba (patch)
tree350af7ee7d4b8d0d22b4f251141f486fa8ae181a /app/models/prometheus_metric.rb
parent8e3523281051490ff696bfd85bea1195c046c87c (diff)
downloadgitlab-ce-4e06ca9e7d67aee59d691a363dabba46d53d34ba.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/prometheus_metric.rb')
-rw-r--r--app/models/prometheus_metric.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/prometheus_metric.rb b/app/models/prometheus_metric.rb
index ea5e11c7a05..9ddf66cd388 100644
--- a/app/models/prometheus_metric.rb
+++ b/app/models/prometheus_metric.rb
@@ -16,11 +16,13 @@ class PrometheusMetric < ApplicationRecord
validates :project, presence: true, unless: :common?
validates :project, absence: true, if: :common?
+ scope :for_dashboard_path, -> (dashboard_path) { where(dashboard_path: dashboard_path) }
scope :for_project, -> (project) { where(project: project) }
scope :for_group, -> (group) { where(group: group) }
scope :for_title, -> (title) { where(title: title) }
scope :for_y_label, -> (y_label) { where(y_label: y_label) }
scope :for_identifier, -> (identifier) { where(identifier: identifier) }
+ scope :not_identifier, -> (identifier) { where.not(identifier: identifier) }
scope :common, -> { where(common: true) }
scope :ordered, -> { reorder(created_at: :asc) }