Sha256: 59c25eda88f6e2e21d7bf43af381c979e034dc15d7a3fc4cdcf6cdfb71d5cf44

Contents?: true

Size: 585 Bytes

Versions: 23

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A moderation belongs to a reportable and includes many reports
  class Moderation < ApplicationRecord
    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"

    delegate :feature, :organization, to: :reportable
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
decidim-0.6.1 decidim-core/app/models/decidim/moderation.rb
decidim-core-0.6.0 app/models/decidim/moderation.rb
decidim-0.6.0 decidim-core/app/models/decidim/moderation.rb