From 74b8ebe5807f29f21ae77b7b8ea324c68cc5c715 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 5 Feb 2017 16:44:44 -0600 Subject: [PATCH] tag.rb: remove unused find_suggestions, increment_view_count. find_suggestions unused since ca3e9bb. --- app/models/tag.rb | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index 10d3754f2..445c001f2 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -79,12 +79,6 @@ class Tag < ActiveRecord::Base end end - module ViewCountMethods - def increment_view_count(name) - Cache.incr("tvc:#{Cache.sanitize(name)}") - end - end - module CategoryMethods module ClassMethods def categories @@ -694,20 +688,6 @@ class Tag < ActiveRecord::Base end end - module SuggestionMethods - def find_suggestions(query) - query_tokens = query.split(/_/) - - if query_tokens.size == 2 - search_for = query_tokens.reverse.join("_").to_escaped_for_sql_like - else - search_for = "%" + query.to_escaped_for_sql_like + "%" - end - - Tag.where(["name LIKE ? ESCAPE E'\\\\' AND post_count > 0 AND name <> ?", search_for, query]).order("post_count DESC").limit(6).select("name").map(&:name).sort - end - end - module SearchMethods def name_matches(name) where("tags.name LIKE ? ESCAPE E'\\\\'", name.mb_chars.downcase.to_escaped_for_sql_like) @@ -789,12 +769,10 @@ class Tag < ActiveRecord::Base include ApiMethods include CountMethods - extend ViewCountMethods include CategoryMethods extend StatisticsMethods extend NameMethods extend ParseMethods include RelationMethods - extend SuggestionMethods extend SearchMethods end