Sha256: 1685c77ccf5a8dd88f90894261bef629facfa7608d3ef689c07e598187549b1b

Contents?: true

Size: 1.11 KB

Versions: 78

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module Decidim
  module Proposals
    # The data store for a Proposal in the Decidim::Proposals component.
    module CommentableCollaborativeDraft
      extend ActiveSupport::Concern
      include Decidim::Comments::Commentable

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

        # Public: Overrides the `accepts_new_comments?` Commentable concern method.
        def accepts_new_comments?
          commentable? && !component.current_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

        # Public: Override Commentable concern method `users_to_notify_on_comment_created`
        def users_to_notify_on_comment_created
          followers
        end
      end
    end
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
decidim-proposals-0.29.1 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.28.4 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.27.9 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.29.0 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.28.3 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.27.8 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.29.0.rc4 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.29.0.rc3 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.29.0.rc2 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.29.0.rc1 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.28.2 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.27.7 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.28.1 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.27.6 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.26.10 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.26.9 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.28.0 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.27.5 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.28.0.rc5 lib/decidim/proposals/commentable_collaborative_draft.rb
decidim-proposals-0.28.0.rc4 lib/decidim/proposals/commentable_collaborative_draft.rb