From 5ac9f0e4f8b04e03173be50418a40665142abbbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Verg=C3=A9s?= Date: Tue, 10 Dec 2024 09:45:33 +0100 Subject: [PATCH] fix m cell --- .../proposal_l_cell_override.rb | 23 ------------------- .../proposal_m_cell_override.rb | 3 +-- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb diff --git a/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb b/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb deleted file mode 100644 index 7d85bd460..000000000 --- a/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -module Decidim - module DecidimAwesome - module ProposalLCellOverride - extend ActiveSupport::Concern - - included do - private - - alias_method :decidim_original_cache_hash, :cache_hash - - def metadata_cell - @metadata_cell ||= awesome_voting_manifest_for(resource&.component)&.proposal_metadata_cell.presence || "decidim/proposals/proposal_metadata" - end - - def cache_hash - @cache_hash ||= "#{decidim_original_cache_hash}#{Decidim.cache_key_separator}#{model.extra_fields&.vote_weight_totals}" - end - end - end - end -end diff --git a/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb b/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb index 297e6ae42..4d92c8295 100644 --- a/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb +++ b/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb @@ -9,8 +9,7 @@ module ProposalMCellOverride alias_method :decidim_original_cache_hash, :cache_hash def cache_hash - extra_hash = model.extra_fields&.reload&.vote_weight_totals - "#{decidim_original_cache_hash}#{Decidim.cache_key_separator}#{extra_hash}" + @cache_hash ||= "#{decidim_original_cache_hash}#{Decidim.cache_key_separator}#{model.extra_fields&.vote_weight_totals}" end end end