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.22.0 app/models/decidim/moderation.rb
decidim-core-0.21.0 app/models/decidim/moderation.rb
decidim-core-0.20.1 app/models/decidim/moderation.rb
decidim-core-0.20.0 app/models/decidim/moderation.rb
decidim-core-0.19.1 app/models/decidim/moderation.rb
decidim-core-0.18.1 app/models/decidim/moderation.rb
decidim-core-0.19.0 app/models/decidim/moderation.rb
decidim-core-0.17.2 app/models/decidim/moderation.rb
decidim-core-0.18.0 app/models/decidim/moderation.rb
decidim-core-0.17.1 app/models/decidim/moderation.rb
decidim-core-0.16.1 app/models/decidim/moderation.rb
decidim-core-0.17.0 app/models/decidim/moderation.rb
decidim-core-0.16.0 app/models/decidim/moderation.rb
decidim-core-0.15.2 app/models/decidim/moderation.rb
decidim-core-0.15.1 app/models/decidim/moderation.rb
decidim-core-0.15.0 app/models/decidim/moderation.rb
decidim-core-0.14.4 app/models/decidim/moderation.rb
decidim-core-0.14.3 app/models/decidim/moderation.rb
decidim-core-0.14.2 app/models/decidim/moderation.rb
decidim-core-0.14.1 app/models/decidim/moderation.rb