Class: Decidim::Amendment
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Amendment
- Defined in:
- app/models/decidim/amendment.rb
Constant Summary collapse
- STATES =
%w(draft evaluating accepted rejected withdrawn).freeze
Instance Method Summary collapse
Instance Method Details
#draft? ⇒ Boolean
13 14 15 |
# File 'app/models/decidim/amendment.rb', line 13 def draft? state == "draft" end |
#evaluating? ⇒ Boolean
17 18 19 |
# File 'app/models/decidim/amendment.rb', line 17 def evaluating? state == "evaluating" end |
#promoted? ⇒ Boolean
25 26 27 28 29 |
# File 'app/models/decidim/amendment.rb', line 25 def promoted? return false unless rejected? emendation.linked_promoted_resource.present? end |
#rejected? ⇒ Boolean
21 22 23 |
# File 'app/models/decidim/amendment.rb', line 21 def rejected? state == "rejected" end |