Class: Decidim::Budgets::Project

Inherits:
ApplicationRecord show all
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

Instance Method Details

#accepts_new_comments?Boolean

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

Returns:

  • (Boolean)


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

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

#commentable?Boolean

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

Returns:

  • (Boolean)


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

def commentable?
  feature.settings.comments_enabled?
end

#comments_have_votes?Boolean

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

Returns:

  • (Boolean)


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

def comments_have_votes?
  true
end

#confirmed_orders_countObject

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



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

def confirmed_orders_count
  orders.finished.count
end

#notifiable?(_context) ⇒ Boolean

Public: Overrides the ‘notifiable?` Notifiable concern method.

Returns:

  • (Boolean)


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

def notifiable?(_context)
  false
end