From 78322b38f4d88dcda210c67c8b2184a86d35fba3 Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Mon, 25 Feb 2019 11:03:45 -0800 Subject: [PATCH] fixes #4064: Artist new page giving false rejection messages --- app/helpers/artists_helper.rb | 2 +- app/models/artist.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/artists_helper.rb b/app/helpers/artists_helper.rb index cf1e7198d..b50241d3a 100644 --- a/app/helpers/artists_helper.rb +++ b/app/helpers/artists_helper.rb @@ -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 diff --git a/app/models/artist.rb b/app/models/artist.rb index ab3da1040..947d91a9f 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -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