Class: Decidim::Budgets::Project
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Budgets::Project
- Includes:
- Comments::Commentable, HasAttachments, HasCategory, HasFeature, HasReference, HasScope, Resourceable
- Defined in:
- decidim-budgets/app/models/decidim/budgets/project.rb
Overview
The data store for a Project in the Decidim::Budgets component. It stores a title, description and any other useful information to render a custom project.
Instance Method Summary collapse
-
#accepts_new_comments? ⇒ Boolean
Public: Overrides the ‘accepts_new_comments?` Commentable concern method.
-
#commentable? ⇒ Boolean
Public: Overrides the ‘commentable?` Commentable concern method.
-
#comments_have_votes? ⇒ Boolean
Public: Overrides the ‘comments_have_votes?` Commentable concern method.
-
#confirmed_orders_count ⇒ Object
Public: Returns the number of times an specific project have been checked out.
Instance Method Details
#accepts_new_comments? ⇒ Boolean
Public: Overrides the ‘accepts_new_comments?` Commentable concern method.
25 26 27 |
# File 'decidim-budgets/app/models/decidim/budgets/project.rb', line 25 def accepts_new_comments? commentable? && !feature.active_step_settings.comments_blocked end |
#commentable? ⇒ Boolean
Public: Overrides the ‘commentable?` Commentable concern method.
20 21 22 |
# File 'decidim-budgets/app/models/decidim/budgets/project.rb', line 20 def commentable? feature.settings.comments_enabled? end |
#comments_have_votes? ⇒ Boolean
Public: Overrides the ‘comments_have_votes?` Commentable concern method.
30 31 32 |
# File 'decidim-budgets/app/models/decidim/budgets/project.rb', line 30 def comments_have_votes? true end |
#confirmed_orders_count ⇒ Object
Public: Returns the number of times an specific project have been checked out.
35 36 37 |
# File 'decidim-budgets/app/models/decidim/budgets/project.rb', line 35 def confirmed_orders_count orders.finished.count end |