Sha256: dd55ed8b2dd090efaa1f637d2c2de71654c74fdf467667c2cd692fbf39820579

Contents?: true

Size: 930 Bytes

Versions: 13

Compression:

Stored size: 930 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ContentBlocks
    class GlobalMenuCell < Decidim::ViewModel
      include Decidim::MenuHelper

      private

      def menu_items
        @menu_items ||= home_content_block_menu.items
      end

      def method_missing(method_name, *_args)
        return super if (engine = engine(method_name)).blank?

        engine.routes.url_helpers
      end

      def respond_to_missing?(method_name, include_private = false)
        method_name.starts_with?("decidim_") || super
      end

      def engine(method_name)
        return if (manifest = Decidim.find_participatory_space_manifest(method_name.to_s.gsub(/\Adecidim_/, ""))).blank?

        manifest.context(:public).engine
      end

      def cache_hash
        ["decidim/content_blocks/global_menu", current_organization.cache_key_with_version, I18n.locale].join(Decidim.cache_key_separator)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.28.4 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.29.0 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.28.3 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.29.0.rc4 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.29.0.rc3 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.29.0.rc2 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.29.0.rc1 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.28.2 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.28.1 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.28.0 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/content_blocks/global_menu_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/content_blocks/global_menu_cell.rb