Sha256: fa973b4f55a09c2cd321be86f70a44c5cedfd47370b2fdba3f5f744c67438173

Contents?: true

Size: 1.15 KB

Versions: 8

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true
module Decidim
  module Results
    # 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.
    class Result < Results::ApplicationRecord
      include Decidim::Resourceable
      include Decidim::HasFeature
      include Decidim::HasScope
      include Decidim::HasCategory
      include Decidim::HasReference
      include Decidim::Comments::Commentable

      feature_manifest_name "results"

      # Public: Overrides the `commentable?` Commentable concern method.
      def commentable?
        feature.settings.comments_enabled?
      end

      # Public: Overrides the `accepts_new_comments?` Commentable concern method.
      def accepts_new_comments?
        commentable? && !feature.active_step_settings.comments_blocked
      end

      # Public: Overrides the `comments_have_alignment?` Commentable concern method.
      def comments_have_alignment?
        true
      end

      # Public: Overrides the `comments_have_votes?` Commentable concern method.
      def comments_have_votes?
        true
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
decidim-results-0.1.0 app/models/decidim/results/result.rb
decidim-0.1.0 decidim-results/app/models/decidim/results/result.rb
decidim-results-0.0.8.1 app/models/decidim/results/result.rb
decidim-0.0.8.1 decidim-results/app/models/decidim/results/result.rb
decidim-results-0.0.7 app/models/decidim/results/result.rb
decidim-0.0.7 decidim-results/app/models/decidim/results/result.rb
decidim-results-0.0.6 app/models/decidim/results/result.rb
decidim-0.0.6 decidim-results/app/models/decidim/results/result.rb