From 17ffc36b60e4d7d7117aa60a93b72a9d53233bf2 Mon Sep 17 00:00:00 2001 From: BrokenEagle Date: Wed, 3 Jan 2018 09:07:58 -0800 Subject: [PATCH] Fix fuzzy autocomlete results --- app/models/tag.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index 918caf46b..8070350cd 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -943,7 +943,7 @@ class Tag < ApplicationRecord tags = Tag.select("DISTINCT ON (name, post_count) *").from(sql_query).order("post_count desc").limit(10) if tags.empty? - tags = Tag.fuzzy_name_matches(name).order_similarity(name).nonempty.limit(10) + tags = Tag.select("tags.name, tags.post_count, tags.category, null AS antecedent_name").fuzzy_name_matches(name).order_similarity(name).nonempty.limit(10) end tags