diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-04-11 06:29:07 +0000 |
---|---|---|
committer | James Lopez <james@gitlab.com> | 2019-04-11 06:29:07 +0000 |
commit | d119d3d1b25aac661e6251addf87b280bd37f0c5 (patch) | |
tree | aeaf0d9503326ec7f51968e8d1de48d83ce90503 /lib/gitlab/import_export | |
parent | 79bf4bdaad438dc0f82771b102f3c07225a428da (diff) | |
download | gitlab-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 'lib/gitlab/import_export')
-rw-r--r-- | lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb b/lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb index b30900f7c61..fcf6a25ab00 100644 --- a/lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb +++ b/lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb @@ -8,7 +8,7 @@ module Gitlab POST_METHOD = 'POST'.freeze INVALID_HTTP_METHOD = 'invalid. Only PUT and POST methods allowed.'.freeze - validates :url, url: true + validates :url, addressable_url: true validate do unless [PUT_METHOD, POST_METHOD].include?(http_method.upcase) |