@@ -1,24 +0,0 @@
|
|||||||
class TagCorrection
|
|
||||||
include ActiveModel::Model
|
|
||||||
include ActiveModel::Serializers::JSON
|
|
||||||
include ActiveModel::Serializers::Xml
|
|
||||||
|
|
||||||
attr_reader :tag
|
|
||||||
delegate :category, :post_count, to: :tag
|
|
||||||
|
|
||||||
def initialize(tag_id)
|
|
||||||
@tag = Tag.find(tag_id)
|
|
||||||
end
|
|
||||||
|
|
||||||
def attributes
|
|
||||||
{ post_count: post_count, category: category, category_cache: category_cache, tag: tag }
|
|
||||||
end
|
|
||||||
|
|
||||||
def category_cache
|
|
||||||
Cache.get("tc:" + Cache.hash(tag.name))
|
|
||||||
end
|
|
||||||
|
|
||||||
def fix!
|
|
||||||
tag.update_category_cache
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user