search: move query parsing code from tag model to post query builder.

This commit is contained in:
evazion
2020-03-06 21:14:50 -06:00
parent 2e0ad42eca
commit 967d398c8e
13 changed files with 583 additions and 598 deletions

View File

@@ -25,7 +25,7 @@ module PostsHelper
return unless post_search_counts_enabled?
return unless params[:action] == "index" && params[:page].nil? && params[:tags].present?
tags = Tag.scan_query(params[:tags]).sort.join(" ")
tags = PostQueryBuilder.scan_query(params[:tags]).sort.join(" ")
sig = generate_reportbooru_signature("ps-#{tags}")
render "posts/partials/index/search_count", sig: sig
end
@@ -63,7 +63,7 @@ module PostsHelper
end
def show_tag_change_notice?
Tag.scan_query(params[:tags]).size == 1 && TagChangeNoticeService.get_forum_topic_id(params[:tags])
PostQueryBuilder.scan_query(params[:tags]).size == 1 && TagChangeNoticeService.get_forum_topic_id(params[:tags])
end
private