Sha256: 24626493970544b6b66be4ea807761fcc7aad496eb4bf774778a94b4fafb1ae1

Contents?: true

Size: 749 Bytes

Versions: 30

Compression:

Stored size: 749 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 :component, :organization, to: :reportable

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

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
decidim-core-0.13.1 app/models/decidim/moderation.rb
decidim-core-0.12.2 app/models/decidim/moderation.rb
decidim-core-0.13.0 app/models/decidim/moderation.rb
decidim-core-0.12.1 app/models/decidim/moderation.rb
decidim-core-0.13.0.pre1 app/models/decidim/moderation.rb
decidim-core-0.12.0 app/models/decidim/moderation.rb
decidim-core-0.11.2 app/models/decidim/moderation.rb
decidim-core-0.12.0.pre app/models/decidim/moderation.rb
decidim-core-0.11.1 app/models/decidim/moderation.rb
decidim-core-0.11.0.pre1 app/models/decidim/moderation.rb