Sha256: 413a121f03c0a1fc1f9dc271a94ac3c4e353cbcd3a7de89a0e02f47b0a95d343
Contents?: true
Size: 689 Bytes
Versions: 6
Compression:
Stored size: 689 Bytes
Contents
# frozen_string_literal: true module Decidim module EnhancedTextwork # # Decorator for collaborative drafts # class CollaborativeDraftPresenter < ParagraphPresenter def author coauthorship = __getobj__.coauthorships.first @author ||= if coauthorship.user_group Decidim::UserGroupPresenter.new(coauthorship.user_group) else Decidim::UserPresenter.new(coauthorship.author) end end alias collaborative_draft paragraph def collaborative_draft_path Decidim::ResourceLocatorPresenter.new(collaborative_draft).path end end end end
Version data entries
6 entries across 6 versions & 1 rubygems