This commit is contained in:
Albert Yi
2018-07-25 11:04:50 -07:00
parent 9082ddf455
commit 77854349e5
6 changed files with 37 additions and 22 deletions

View File

@@ -115,7 +115,7 @@ class ArtistUrl < ApplicationRecord
def validate_url_format
uri = Addressable::URI.parse(url)
errors[:url] << " #{uri} must begin with http:// or https://" if !uri.scheme.in?(%w[http https])
errors[:url] << "#{uri} must begin with http:// or https://" if !uri.scheme.in?(%w[http https])
rescue Addressable::URI::InvalidURIError => error
errors[:url] << "is malformed: #{error}"
end