Class: Decidim::Proposals::CollaborativeDraftPresenter

Inherits:
ProposalPresenter
  • Object
show all
Defined in:
decidim-proposals/app/presenters/decidim/proposals/collaborative_draft_presenter.rb

Overview

Decorator for collaborative drafts

Instance Method Summary collapse

Instance Method Details

#authorObject



9
10
11
12
13
14
15
16
# File 'decidim-proposals/app/presenters/decidim/proposals/collaborative_draft_presenter.rb', line 9

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

#collaborative_draft_pathObject



20
21
22
# File 'decidim-proposals/app/presenters/decidim/proposals/collaborative_draft_presenter.rb', line 20

def collaborative_draft_path
  Decidim::ResourceLocatorPresenter.new(collaborative_draft).path
end