Sha256: 7622d6bcf5edda9e0fb8988a32dab324275e6d6cc38832b27c980b5f0a0113f0

Contents?: true

Size: 747 Bytes

Versions: 13

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ContentBlocks
    class HighlightedElementsCell < BaseCell
      include Decidim::ContentBlocks::HasRelatedComponents

      def published_components
        @published_components ||= if model.settings.try(:component_id).present?
                                    components.published.where(id: model.settings.component_id)
                                  else
                                    components.published
                                  end
      end

      def block_id
        "#{model.scope_name}-#{model.manifest_name}".parameterize.gsub("_", "-")
      end

      private

      def components
        @components ||= components_for(model)
      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/highlighted_elements_cell.rb
decidim-core-0.28.4 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.29.0 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.28.3 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.29.0.rc4 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.29.0.rc3 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.29.0.rc2 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.29.0.rc1 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.28.2 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.28.1 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.28.0 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/content_blocks/highlighted_elements_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/content_blocks/highlighted_elements_cell.rb