Class: Decidim::Amendment
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Amendment
- Defined in:
- decidim-core/app/models/decidim/amendment.rb
Constant Summary collapse
- STATES =
%w(draft evaluating accepted rejected withdrawn).freeze
Instance Method Summary collapse
- #draft? ⇒ Boolean
- #evaluating? ⇒ Boolean
-
#mapped_resource_type ⇒ String
Reports the mapped resource type for authorization transfers.
- #promoted? ⇒ Boolean
- #rejected? ⇒ Boolean
Instance Method Details
#draft? ⇒ Boolean
20 21 22 |
# File 'decidim-core/app/models/decidim/amendment.rb', line 20 def draft? state == "draft" end |
#evaluating? ⇒ Boolean
24 25 26 |
# File 'decidim-core/app/models/decidim/amendment.rb', line 24 def evaluating? state == "evaluating" end |
#mapped_resource_type ⇒ String
Reports the mapped resource type for authorization transfers.
16 17 18 |
# File 'decidim-core/app/models/decidim/amendment.rb', line 16 def mapped_resource_type decidim_amendable_type end |
#promoted? ⇒ Boolean
32 33 34 35 36 |
# File 'decidim-core/app/models/decidim/amendment.rb', line 32 def promoted? return false unless rejected? emendation.linked_promoted_resource.present? end |
#rejected? ⇒ Boolean
28 29 30 |
# File 'decidim-core/app/models/decidim/amendment.rb', line 28 def rejected? state == "rejected" end |