Sha256: f31581b8113ff312197e7f5369b63baec68bba892e93e494509c3d5e37d0eefc

Contents?: true

Size: 473 Bytes

Versions: 5

Compression:

Stored size: 473 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ContentBlocks
    class StatsCell < Decidim::ViewModel
      cache :show, expires_in: 10.minutes, if: :perform_caching? do
        cache_hash
      end

      def stats
        @stats ||= HomeStatsPresenter.new(organization: current_organization)
      end

      private

      def cache_hash
        hash = []
        hash.push(I18n.locale)
        hash.join(Decidim.cache_key_separator)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-core-0.26.2 app/cells/decidim/content_blocks/stats_cell.rb
decidim-core-0.26.1 app/cells/decidim/content_blocks/stats_cell.rb
decidim-core-0.26.0 app/cells/decidim/content_blocks/stats_cell.rb
decidim-core-0.26.0.rc2 app/cells/decidim/content_blocks/stats_cell.rb
decidim-core-0.26.0.rc1 app/cells/decidim/content_blocks/stats_cell.rb