#1383: Remove banned_artist tag
This commit is contained in:
@@ -205,16 +205,19 @@ class Artist < ActiveRecord::Base
|
||||
def unban!
|
||||
Post.transaction do
|
||||
CurrentUser.without_safe_mode do
|
||||
ti = TagImplication.where(:antecedent_name => name, :consequent_name => "banned_artist").first
|
||||
ti.destroy if ti
|
||||
|
||||
begin
|
||||
Post.tag_match(name).each do |post|
|
||||
post.unban!
|
||||
fixed_tags = post.tag_string.sub(/(?:\A| )banned_artist(?:\Z| )/, " ").strip
|
||||
post.update_attributes(:tag_string => fixed_tags)
|
||||
end
|
||||
rescue Post::SearchError
|
||||
# swallow
|
||||
end
|
||||
|
||||
ti = TagImplication.where(:antecedent_name => name, :consequent_name => "banned_artist").first
|
||||
ti.destroy if ti
|
||||
update_column(:is_banned, false)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<% end %>
|
||||
<% if CurrentUser.is_admin? %>
|
||||
<% if @artist.is_banned? %>
|
||||
<li><%= link_to "unban", unban_artist_path(@artist), :method => :put, :confirm => "Are you sure you want to unban this artist?" %></li>
|
||||
<li><%= link_to "Unban", unban_artist_path(@artist), :method => :put, :confirm => "Are you sure you want to unban this artist?" %></li>
|
||||
|
||||
<% else %>
|
||||
<li><%= link_to "Ban", ban_artist_path(@artist), :method => :put, :confirm => "Are you sure you want to ban this artist?" %></li>
|
||||
|
||||
Reference in New Issue
Block a user