Class: Decidim::Budgets::Project
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Budgets::Project
- Includes:
- Comments::Commentable, Followable, HasAttachmentCollections, HasAttachments, HasCategory, HasFeature, HasReference, Resourceable, ScopableFeature
- Defined in:
- 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.
-
#users_to_notify_on_comment_created ⇒ Object
Public: Overrides the ‘users_to_notify_on_comment_created` Commentable concern method.
Instance Method Details
#accepts_new_comments? ⇒ Boolean
Public: Overrides the ‘accepts_new_comments?` Commentable concern method.
28 29 30 |
# File 'app/models/decidim/budgets/project.rb', line 28 def accepts_new_comments? commentable? && !feature.current_settings.comments_blocked end |
#commentable? ⇒ Boolean
Public: Overrides the ‘commentable?` Commentable concern method.
23 24 25 |
# File 'app/models/decidim/budgets/project.rb', line 23 def commentable? feature.settings.comments_enabled? end |
#comments_have_votes? ⇒ Boolean
Public: Overrides the ‘comments_have_votes?` Commentable concern method.
33 34 35 |
# File 'app/models/decidim/budgets/project.rb', line 33 def comments_have_votes? true end |
#confirmed_orders_count ⇒ Object
Public: Returns the number of times an specific project have been checked out.
43 44 45 |
# File 'app/models/decidim/budgets/project.rb', line 43 def confirmed_orders_count orders.finished.count end |
#users_to_notify_on_comment_created ⇒ Object
Public: Overrides the ‘users_to_notify_on_comment_created` Commentable concern method.
38 39 40 |
# File 'app/models/decidim/budgets/project.rb', line 38 def users_to_notify_on_comment_created followers end |