Class: Decidim::Proposals::CollaborativeDraft
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Proposals::CollaborativeDraft
- Includes:
- Coauthorable, Followable, HasAttachments, HasCategory, HasComponent, HasReference, Loggable, CommentableCollaborativeDraft, Reportable, Resourceable, ScopableComponent, Traceable
- Defined in:
- app/models/decidim/proposals/collaborative_draft.rb
Instance Method Summary collapse
-
#editable_by?(user) ⇒ Boolean
Checks whether the user can edit the given proposal.
- #open? ⇒ Boolean
- #published? ⇒ Boolean
-
#reported_content_url ⇒ Object
Public: Overrides the ‘reported_content_url` Reportable concern method.
- #withdrawn? ⇒ Boolean
Instance Method Details
#editable_by?(user) ⇒ Boolean
Checks whether the user can edit the given proposal.
user - the user to check for authorship
40 41 42 |
# File 'app/models/decidim/proposals/collaborative_draft.rb', line 40 def editable_by?(user) (user) end |
#open? ⇒ Boolean
44 45 46 |
# File 'app/models/decidim/proposals/collaborative_draft.rb', line 44 def open? state == "open" end |
#published? ⇒ Boolean
52 53 54 |
# File 'app/models/decidim/proposals/collaborative_draft.rb', line 52 def published? state == "published" end |
#reported_content_url ⇒ Object
Public: Overrides the ‘reported_content_url` Reportable concern method.
57 58 59 |
# File 'app/models/decidim/proposals/collaborative_draft.rb', line 57 def reported_content_url ResourceLocatorPresenter.new(self).url end |
#withdrawn? ⇒ Boolean
48 49 50 |
# File 'app/models/decidim/proposals/collaborative_draft.rb', line 48 def withdrawn? state == "withdrawn" end |