BURs: move cosplay tags when moving character tags.
When aliasing or renaming a character tag, move the corresponding *_(cosplay) tag if it exists.
This commit is contained in:
@@ -9,6 +9,7 @@ class TagMover
|
||||
|
||||
def move!
|
||||
CurrentUser.scoped(user) do
|
||||
move_cosplay_tag!
|
||||
move_tag_category!
|
||||
move_artist!
|
||||
move_wiki!
|
||||
@@ -56,6 +57,15 @@ class TagMover
|
||||
end
|
||||
end
|
||||
|
||||
def move_cosplay_tag!
|
||||
old_cosplay_tag = "#{old_tag.name}_(cosplay)"
|
||||
new_cosplay_tag = "#{new_tag.name}_(cosplay)"
|
||||
|
||||
if Tag.nonempty.where(name: old_cosplay_tag).exists?
|
||||
TagMover.new(old_cosplay_tag, new_cosplay_tag).move!
|
||||
end
|
||||
end
|
||||
|
||||
def move_saved_searches!
|
||||
SavedSearch.rewrite_queries!(old_tag.name, new_tag.name)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user