diff --git a/app/models/artist.rb b/app/models/artist.rb index 30a82c3dc..900fbac5b 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -179,8 +179,12 @@ class Artist < ActiveRecord::Base post.delete! end - tag_implication = TagImplication.create(:antecedent_name => name, :consequent_name => "banned_artist") - tag_implication.delay.process! + # potential race condition but unlikely + unless TagImplication.where(:antecedent_name => name, :consequent_name => "banned_artist").exists? + tag_implication = TagImplication.create(:antecedent_name => name, :consequent_name => "banned_artist") + tag_implication.delay.process! + end + update_column(:is_active, false) update_column(:is_banned, true) end diff --git a/app/views/artists/_secondary_links.html.erb b/app/views/artists/_secondary_links.html.erb index e705d20a8..34e8492dd 100644 --- a/app/views/artists/_secondary_links.html.erb +++ b/app/views/artists/_secondary_links.html.erb @@ -1,6 +1,7 @@ <% content_for(:secondary_links) do %>
  • <%= link_to "Listing", artists_path %>
  • +
  • <%= link_to "Banned", banned_artists_path %>
  • <%= link_to "Search", search_artists_path %>
  • <%= link_to "New", new_artist_path %>
  • <%= link_to "Recent changes", artist_versions_path %>
  • diff --git a/test/factories/pool.rb b/test/factories/pool.rb index 1bc64ac79..f38d2e5a3 100644 --- a/test/factories/pool.rb +++ b/test/factories/pool.rb @@ -1,5 +1,5 @@ Factory.define(:pool) do |f| - f.name {Faker::Name.first_name} + f.name {(rand(1_000_000) + 100).to_s} f.creator {|x| x.association(:user)} f.description {Faker::Lorem.sentences} end diff --git a/tmp/test-large.jpg b/tmp/test-large.jpg deleted file mode 100644 index c27382e5f..000000000 Binary files a/tmp/test-large.jpg and /dev/null differ