Class: Decidim::Results::Result

Inherits:
ApplicationRecord show all
Includes:
Comments::Commentable, HasCategory, HasFeature, HasReference, HasScope, Decidim::Resourceable
Defined in:
decidim-results/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)


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

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

#commentable?Boolean

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

Returns:

  • (Boolean)


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

def commentable?
  feature.settings.comments_enabled?
end

#comments_have_alignment?Boolean

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

Returns:

  • (Boolean)


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

def comments_have_alignment?
  true
end

#comments_have_votes?Boolean

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

Returns:

  • (Boolean)


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

def comments_have_votes?
  true
end