Sha256: 42ed545ec0870cbe041fbf8e91dd927b44f2ee93c32e8d66e4869dbcf553fcd6

Contents?: true

Size: 631 Bytes

Versions: 1

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ReportingProposals
    # Exposes the proposal resource so users can view and create them.
    module LinkedResourcesForCellOverride
      extend ActiveSupport::Concern

      included do
        private

        def linked_resources
          @linked_resources ||= begin
            query = resource.linked_resources(type, link_name)
            query = query.or(resource.linked_resources(:reporting_proposals, link_name)) if type == :proposals

            query.group_by { |linked_resource| linked_resource.class.name }
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
decidim-reporting_proposals-0.6.0 app/cells/concerns/decidim/reporting_proposals/linked_resources_for_cell_override.rb