tags: eliminate Tag.category_for method.
Tag.category_for looked up a tag's category in the Redis cache. This was only used in a few places (in related tags, and on the popular/missed search pages). Get rid of this method so we can work towards getting rid of caching tag categories in Redis.
This commit is contained in:
@@ -127,18 +127,6 @@ class Tag < ApplicationRecord
|
||||
Tag.where(name: tag_name).pick(:category).to_i
|
||||
end
|
||||
|
||||
def category_for(tag_name, options = {})
|
||||
return Tag.categories.general if tag_name.blank?
|
||||
|
||||
if options[:disable_caching]
|
||||
select_category_for(tag_name)
|
||||
else
|
||||
Cache.get("tc:#{Cache.hash(tag_name)}") do
|
||||
select_category_for(tag_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def categories_for(tag_names, options = {})
|
||||
if options[:disable_caching]
|
||||
Array(tag_names).inject({}) do |hash, tag_name|
|
||||
|
||||
Reference in New Issue
Block a user