This commit is contained in:
r888888888
2014-03-07 16:42:20 -08:00
parent 08b9b2771f
commit 0724f6ca06
5 changed files with 42 additions and 2 deletions

View File

@@ -202,6 +202,24 @@ class Artist < ActiveRecord::Base
end
module BanMethods
def unban!
Post.transaction do
CurrentUser.without_safe_mode do
begin
Post.tag_match(name).each do |post|
post.unban!
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
end
def ban!
Post.transaction do
CurrentUser.without_safe_mode do