Sha256: 4367acd75329b5b312286e23ac0e474c87c6c124c9425d5b3fa555147a0c1b2d
Contents?: true
Size: 690 Bytes
Versions: 24
Compression:
Stored size: 690 Bytes
Contents
# frozen_string_literal: true require "cell/partial" module Decidim # This cell renders the list of endorsers. # # Example: # # cell("decidim/endorsers_list", my_component) class EndorsersListCell < Decidim::ViewModel include ApplicationHelper def show return unless endorsers.any? render end private # Finds the correct author for each endorsement. # # Returns an Array of presented Users/UserGroups def endorsers @endorsers ||= model.endorsements.for_listing .includes(:author, :user_group) .map { |identity| present(identity.normalized_author) } end end end
Version data entries
24 entries across 24 versions & 1 rubygems