TagSetPresenter: refactor humanized_essential_tag_string.
Move Post#humanized_essential_tag_string to TagSetPresenter#humanized_essential_tag_string. This allows humanized_essential_tag_string to reuse the same set of tags already fetched by the tag set presenter for the sidebar. This avoids fetching the tag categories from memcache again (via Post#typed_tags) when we're already fetched the tags once before. This also means it's no longer necessary to cache humanized_essential_tag_string itself in memcache, since it can be generated as quickly as the sidebar taglist.
This commit is contained in:
@@ -144,7 +144,7 @@ class PostPresenter < Presenter
|
||||
end
|
||||
|
||||
def humanized_essential_tag_string
|
||||
@post.humanized_essential_tag_string
|
||||
@humanized_essential_tag_string ||= tag_set_presenter.humanized_essential_tag_string(default: "##{@post.id}")
|
||||
end
|
||||
|
||||
def filename_for_download
|
||||
|
||||
Reference in New Issue
Block a user