Sha256: eed53c2c00633a9f9001c101c656a0240548f45b169866ea5d2cc50b8de56e45

Contents?: true

Size: 629 Bytes

Versions: 4

Compression:

Stored size: 629 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_process, foreign_key: "decidim_participatory_process_id", class_name: Decidim::ParticipatoryProcess
    has_many :reports, foreign_key: "decidim_moderation_id", class_name: "Decidim::Report"

    validates :reportable, :participatory_process, presence: true

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-core-0.1.0 app/models/decidim/moderation.rb
decidim-core-0.0.8.1 app/models/decidim/moderation.rb
decidim-core-0.0.7 app/models/decidim/moderation.rb
decidim-core-0.0.6 app/models/decidim/moderation.rb