This commit is contained in:
Albert Yi
2018-05-24 10:24:14 -07:00
parent 3f40929ca1
commit b7c4df2df0
2 changed files with 8 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ class ArtistUrl < ApplicationRecord
before_validation :parse_prefix
before_save :initialize_normalized_url, on: [ :create ]
before_save :normalize
validates_presence_of :url
validates :url, presence: true, uniqueness: true
validate :validate_url_format
belongs_to :artist, :touch => true