diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/models/alert_management | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) | |
download | gitlab-ce-f64a639bcfa1fc2bc89ca7db268f594306edfd7c.tar.gz |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/models/alert_management')
-rw-r--r-- | app/models/alert_management/http_integration.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/alert_management/http_integration.rb b/app/models/alert_management/http_integration.rb index 2d9a2d7031c..e98c770c364 100644 --- a/app/models/alert_management/http_integration.rb +++ b/app/models/alert_management/http_integration.rb @@ -27,6 +27,7 @@ module AlertManagement before_validation :prevent_token_assignment before_validation :prevent_endpoint_identifier_assignment before_validation :ensure_token + before_validation :ensure_payload_example_not_nil scope :for_endpoint_identifier, -> (endpoint_identifier) { where(endpoint_identifier: endpoint_identifier) } scope :active, -> { where(active: true) } @@ -74,5 +75,9 @@ module AlertManagement self.endpoint_identifier = endpoint_identifier_was end end + + def ensure_payload_example_not_nil + self.payload_example ||= {} + end end end |