summaryrefslogtreecommitdiff
path: root/app/models/environment.rb
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-04-11 06:29:07 +0000
committerJames Lopez <james@gitlab.com>2019-04-11 06:29:07 +0000
commitd119d3d1b25aac661e6251addf87b280bd37f0c5 (patch)
treeaeaf0d9503326ec7f51968e8d1de48d83ce90503 /app/models/environment.rb
parent79bf4bdaad438dc0f82771b102f3c07225a428da (diff)
downloadgitlab-ce-d119d3d1b25aac661e6251addf87b280bd37f0c5.tar.gz
Align UrlValidator to validate_url gem implementation.
Renamed UrlValidator to AddressableUrlValidator to avoid 'url:' naming collision with ActiveModel::Validations::UrlValidator in 'validates' statement. Make use of the options attribute of the parent class ActiveModel::EachValidator. Add more options: allow_nil, allow_blank, message. Renamed 'protocols' option to 'schemes' to match the option naming from UrlValidator.
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index fa29a83e517..69224635e34 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -35,7 +35,7 @@ class Environment < ApplicationRecord
validates :external_url,
length: { maximum: 255 },
allow_nil: true,
- url: true
+ addressable_url: true
delegate :stop_action, :manual_actions, to: :last_deployment, allow_nil: true