potential fix for #3727

This commit is contained in:
Albert Yi
2018-05-25 10:16:52 -07:00
parent c97b0245d6
commit 63ab637419
2 changed files with 3 additions and 4 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 :url, presence: true, uniqueness: true
validates :url, presence: true, uniqueness: { scope: :artist_id }
validate :validate_url_format
belongs_to :artist, :touch => true