diff options
author | James Lopez <james@jameslopez.es> | 2016-06-20 17:20:53 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-06-20 17:20:53 +0200 |
commit | 6d763831d00027600e4da9807e6be3afb47abd4b (patch) | |
tree | 94ddbd0eb2d1457d1105e118317ee32d96e3f758 /app/validators | |
parent | 896e09d055979cdfe6e20a8b5939c9a263f7e48a (diff) | |
download | gitlab-ce-6d763831d00027600e4da9807e6be3afb47abd4b.tar.gz |
fixed a few MySQL issues and added changelog
Diffstat (limited to 'app/validators')
-rw-r--r-- | app/validators/addressable_url_validator.rb | 6 |
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 |