Class: Decidim::Results::Result

Inherits:
ApplicationRecord show all
Includes:
Comments::Commentable, Followable, HasCategory, HasFeature, HasReference, HasScope, Decidim::Resourceable
Defined in:
app/models/decidim/results/result.rb

Overview

The data store for a Result in the Decidim::Results component. It stores a title, description and any other useful information to render a custom result.

Instance Method Summary collapse

Instance Method Details

#accepts_new_comments? ⇒ Boolean

Public: Overrides the accepts_new_comments? Commentable concern method.

Returns:

  • (Boolean)


24
25
26
# File 'app/models/decidim/results/result.rb', line 24

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

#commentable? ⇒ Boolean

Public: Overrides the commentable? Commentable concern method.

Returns:

  • (Boolean)


19
20
21
# File 'app/models/decidim/results/result.rb', line 19

def commentable?
  feature.settings.comments_enabled?
end

#comments_have_alignment? ⇒ Boolean

Public: Overrides the comments_have_alignment? Commentable concern method.

Returns:

  • (Boolean)


29
30
31
# File 'app/models/decidim/results/result.rb', line 29

def comments_have_alignment?
  true
end

#comments_have_votes? ⇒ Boolean

Public: Overrides the comments_have_votes? Commentable concern method.

Returns:

  • (Boolean)


34
35
36
# File 'app/models/decidim/results/result.rb', line 34

def comments_have_votes?
  true
end

#users_to_notify_on_comment_created ⇒ Object

Public: Override Commentable concern method users_to_notify_on_comment_created



39
40
41
# File 'app/models/decidim/results/result.rb', line 39

def users_to_notify_on_comment_created
  (followers | feature.participatory_space.admins).uniq
end