Extract method in comments component

This commit is contained in:
Javi Martín
2021-06-26 21:53:32 +02:00
parent c3e0a6b089
commit beb24670ab
2 changed files with 14 additions and 1 deletions

View File

@@ -6,4 +6,17 @@ class Shared::CommentsComponent < ApplicationComponent
@record = record
@comment_tree = comment_tree
end
private
def cache_key
[
locale_and_user_status,
current_order,
commentable_cache_key(record),
comment_tree.comments,
comment_tree.comment_authors,
record.comments_count
]
end
end