Sha256: 1182a0d1ace0b8209067e3bc529182b06d1618a25020da4bd6af08bea3e36f70
Contents?: true
Size: 1018 Bytes
Versions: 11
Compression:
Stored size: 1018 Bytes
Contents
# frozen_string_literal: true module Decidim module Votings module ContentBlocks class HighlightedVotingsCell < Decidim::ViewModel delegate :current_user, to: :controller def show render if highlighted_votings.any? end def max_results model.settings.max_results end def highlighted_votings OrganizationPrioritizedVotings.new(current_organization, current_user) .query .limit(max_results) end def i18n_scope "decidim.votings.pages.home.highlighted_votings" end def decidim_votings Decidim::Votings::Engine.routes.url_helpers end private def cache_hash hash = [] hash.push(I18n.locale) hash.push(highlighted_votings.map(&:cache_key_with_version)) hash.join(Decidim.cache_key_separator) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems