diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-16 00:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-16 00:08:49 +0300 |
commit | cf1d4237a4f226ba2deed26240544da0675a41e5 (patch) | |
tree | 926a71b9279659bc52db0187b463603934718bf2 /app/models | |
parent | 0ac82f99553ce12009970a14c0afc02d1f6515bb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/error_tracking/project_error_tracking_setting.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/models/service.rb | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/app/models/error_tracking/project_error_tracking_setting.rb b/app/models/error_tracking/project_error_tracking_setting.rb index 88a2531d649..d328a609439 100644 --- a/app/models/error_tracking/project_error_tracking_setting.rb +++ b/app/models/error_tracking/project_error_tracking_setting.rb @@ -27,6 +27,8 @@ module ErrorTracking validates :api_url, length: { maximum: 255 }, public_url: { enforce_sanitization: true, ascii_only: true }, allow_nil: true + validates :enabled, inclusion: { in: [true, false] } + validates :api_url, presence: { message: 'is a required field' }, if: :enabled validate :validate_api_url_path, if: :enabled diff --git a/app/models/project.rb b/app/models/project.rb index a215b6c881c..1e27ce9f344 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -2334,7 +2334,7 @@ class Project < ApplicationRecord end def alerts_service_activated? - false + alerts_service&.active? end def self_monitoring? diff --git a/app/models/service.rb b/app/models/service.rb index 95b7c6927cf..e60dda59176 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -260,6 +260,7 @@ class Service < ApplicationRecord def self.available_services_names service_names = %w[ + alerts asana assembla bamboo |