Class: Decidim::Budgets::Project

Inherits:
ApplicationRecord show all
Includes:
Comments::Commentable, Followable, HasAttachments, HasCategory, HasFeature, HasReference, HasScope, Resourceable
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

Instance Method Details

#accepts_new_comments?Boolean

Public: Overrides the ‘accepts_new_comments?` Commentable concern method.

Returns:

  • (Boolean)


27
28
29
# File 'app/models/decidim/budgets/project.rb', line 27

def accepts_new_comments?
  commentable? && !feature.current_settings.comments_blocked
end

#commentable?Boolean

Public: Overrides the ‘commentable?` Commentable concern method.

Returns:

  • (Boolean)


22
23
24
# File 'app/models/decidim/budgets/project.rb', line 22

def commentable?
  feature.settings.comments_enabled?
end

#comments_have_votes?Boolean

Public: Overrides the ‘comments_have_votes?` Commentable concern method.

Returns:

  • (Boolean)


32
33
34
# File 'app/models/decidim/budgets/project.rb', line 32

def comments_have_votes?
  true
end

#confirmed_orders_countObject

Public: Returns the number of times an specific project have been checked out.



42
43
44
# File 'app/models/decidim/budgets/project.rb', line 42

def confirmed_orders_count
  orders.finished.count
end

#users_to_notify_on_comment_createdObject

Public: Overrides the ‘users_to_notify_on_comment_created` Commentable concern method.



37
38
39
# File 'app/models/decidim/budgets/project.rb', line 37

def users_to_notify_on_comment_created
  followers
end