fixes #4064: Artist new page giving false rejection messages

This commit is contained in:
Albert Yi
2019-02-25 11:03:45 -08:00
parent 25c495f2fb
commit 78322b38f4
2 changed files with 4 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ module ArtistsHelper
if artist
link_to(artist.name, artist_path(artist))
else
link_to(name, new_artist_path(:name => name)) + " " + content_tag("span", "*", :class => "new-artist", :title => "No artist with this name currently exists.")
link_to(name, new_artist_path(artist: {name: name})) + " " + content_tag("span", "*", :class => "new-artist", :title => "No artist with this name currently exists.")
end
end

View File

@@ -329,7 +329,9 @@ class Artist < ApplicationRecord
artist = Artist.new(params)
end
artist.tap(&:validate) # run before_validation callbacks to normalize the names
artist.normalize_name
artist.normalize_other_names
artist
end
end