From 6d763831d00027600e4da9807e6be3afb47abd4b Mon Sep 17 00:00:00 2001 From: James Lopez Date: Mon, 20 Jun 2016 17:20:53 +0200 Subject: fixed a few MySQL issues and added changelog --- app/validators/addressable_url_validator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/validators') 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 -- cgit v1.2.1