summaryrefslogtreecommitdiff
path: root/app/validators
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-06-20 15:31:03 +0200
committerJames Lopez <james@jameslopez.es>2016-06-20 15:31:03 +0200
commit896e09d055979cdfe6e20a8b5939c9a263f7e48a (patch)
treeecd0a544c3cfd6be28959c44463cde534a507e92 /app/validators
parenta5abec905fc69a9999887ea11335f032b4dfa957 (diff)
downloadgitlab-ce-896e09d055979cdfe6e20a8b5939c9a263f7e48a.tar.gz
started working on a migration for projects that have current import_url issues
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/addressable_url_validator.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/validators/addressable_url_validator.rb b/app/validators/addressable_url_validator.rb
index 7aab66548e2..585dc182e27 100644
--- a/app/validators/addressable_url_validator.rb
+++ b/app/validators/addressable_url_validator.rb
@@ -1,6 +1,6 @@
# AddressableUrlValidator
#
-# Custom validator for URLs. This is a
+# Custom validator for URLs. This is a
#
# By default, only URLs for http, https, ssh, and git protocols will be considered valid.
# Provide a `:protocols` option to configure accepted protocols.
@@ -22,12 +22,6 @@ class AddressableUrlValidator < ActiveModel::EachValidator
end
end
- private
-
- def default_options
- @default_options ||= { protocols: %w(http https ssh git) }
- end
-
def valid_url?(value)
return false unless value
@@ -38,6 +32,12 @@ class AddressableUrlValidator < ActiveModel::EachValidator
false
end
+ private
+
+ def default_options
+ @default_options ||= { protocols: %w(http https ssh git) }
+ end
+
def valid_uri?(value)
Addressable::URI.parse(value).is_a?(Addressable::URI)
end