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:
authorJames Lopez <james@jameslopez.es>2016-06-20 18:20:53 +0300
committerJames Lopez <james@jameslopez.es>2016-06-20 18:20:53 +0300
commit6d763831d00027600e4da9807e6be3afb47abd4b (patch)
tree94ddbd0eb2d1457d1105e118317ee32d96e3f758 /app/validators
parent896e09d055979cdfe6e20a8b5939c9a263f7e48a (diff)
fixed a few MySQL issues and added changelog
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