diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 12:09:34 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 12:09:34 +0000 |
commit | 903ccf7c93eb9490c76857bffe744249cc07de09 (patch) | |
tree | 603a3162e91999160e4efc74f351f9405f422d61 /app/models/project_services | |
parent | 41cb558299b483b44b45351730ee4c0e9fe4ca2c (diff) | |
download | gitlab-ce-903ccf7c93eb9490c76857bffe744249cc07de09.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project_services')
-rw-r--r-- | app/models/project_services/prometheus_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/project_services/prometheus_service.rb b/app/models/project_services/prometheus_service.rb index fd4ee069041..17bc29ebdcf 100644 --- a/app/models/project_services/prometheus_service.rb +++ b/app/models/project_services/prometheus_service.rb @@ -13,9 +13,9 @@ class PrometheusService < MonitoringService # to allow localhost URLs when the following conditions are true: # 1. project is the self-monitoring project. # 2. api_url is the internal Prometheus URL. - with_options presence: true, if: :manual_configuration? do - validates :api_url, public_url: true, unless: proc { |object| object.allow_local_api_url? } - validates :api_url, url: true, if: proc { |object| object.allow_local_api_url? } + with_options presence: true do + validates :api_url, public_url: true, if: ->(object) { object.manual_configuration? && !object.allow_local_api_url? } + validates :api_url, url: true, if: ->(object) { object.manual_configuration? && object.allow_local_api_url? } end before_save :synchronize_service_state |