tag.rb: remove unused find_suggestions, increment_view_count.
find_suggestions unused since ca3e9bb.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user