Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/addressable_url_validator.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/validators/addressable_url_validator.rb b/app/validators/addressable_url_validator.rb
index 585dc182e27..ee6a5a11850 100644
--- a/app/validators/addressable_url_validator.rb
+++ b/app/validators/addressable_url_validator.rb
@@ -22,6 +22,8 @@ class AddressableUrlValidator < ActiveModel::EachValidator
end
end
+ private
+
def valid_url?(value)
return false unless value
@@ -32,8 +34,6 @@ class AddressableUrlValidator < ActiveModel::EachValidator
false
end
- private
-
def default_options
@default_options ||= { protocols: %w(http https ssh git) }
end
@@ -44,6 +44,6 @@ class AddressableUrlValidator < ActiveModel::EachValidator
def valid_protocol?(value)
options = default_options.merge(self.options)
- value =~ /\A#{URI.regexp(options[:protocols])}\z/
+ !!(value =~ /\A#{URI.regexp(options[:protocols])}\z/)
end
end