Sha256: 5a6adf1aa58a3d39b995bee59d8f0c1cd896b200ba9d868f1b7b0d0787deddf5

Contents?: true

Size: 747 Bytes

Versions: 2

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A moderation belongs to a reportable and includes many reports
  class Moderation < ApplicationRecord
    include Traceable
    include Loggable

    belongs_to :reportable, foreign_key: "decidim_reportable_id", foreign_type: "decidim_reportable_type", polymorphic: true
    belongs_to :participatory_space, foreign_key: "decidim_participatory_space_id", foreign_type: "decidim_participatory_space_type", polymorphic: true
    has_many :reports, foreign_key: "decidim_moderation_id", class_name: "Decidim::Report", dependent: :destroy

    delegate :feature, :organization, to: :reportable

    def self.log_presenter_class_for(_log)
      Decidim::AdminLog::ModerationPresenter
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
decidim-core-0.10.1 app/models/decidim/moderation.rb
decidim-core-0.10.0 app/models/decidim/moderation.rb