Fix #3270: Filter tag search results for deleted wikis.

This commit is contained in:
evazion
2017-08-15 23:42:43 -05:00
parent 3e04f0f6b1
commit 9d28a2491a

View File

@@ -820,9 +820,9 @@ class Tag < ApplicationRecord
end
if params[:has_wiki] == "yes"
q = q.joins(:wiki_page)
q = q.joins(:wiki_page).where("wiki_pages.is_deleted = false")
elsif params[:has_wiki] == "no"
q = q.joins("LEFT JOIN wiki_pages ON tags.name = wiki_pages.title").where("wiki_pages.title IS NULL")
q = q.joins("LEFT JOIN wiki_pages ON tags.name = wiki_pages.title").where("wiki_pages.title IS NULL OR wiki_pages.is_deleted = true")
end
if params[:has_artist] == "yes"