Skip to content

Commit 2289c1b

Browse files
committed
add current user into cache keys
1 parent a3e489f commit 2289c1b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

decidim-proposals/app/cells/decidim/proposals/proposal_g_cell.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def cache_hash
6262
hash << Digest::MD5.hexdigest(model.authors.map(&:cache_key_with_version).to_s)
6363
hash << (model.must_render_translation?(model.organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
6464
hash << model.component.participatory_space.active_step.id if model.component.participatory_space.try(:active_step)
65-
hash << model.voted_by?(current_user)
65+
hash << model.voted_by?(current_user) ? 1 : 0
66+
hash << (current_user&.id || 0)
6667
hash.join(Decidim.cache_key_separator)
6768
end
6869
end

0 commit comments

Comments
 (0)