discourse/app/models/reviewable_action_log.rb
Gary Pendergast 4a7032f56b
DEV: Add a new ReviewableActionLog model. (#36057)
As part of the review queue refresh, moderators will be able to perform
individual actions on each part of a reviewable (for example, hiding a
post, and suspending the user). In order to know when a reviewable is
"completed", we need to be able to check that the right number of
actions have been performed on the reviewable.

This change adds a `ReviewableActionLog` model where we can keep track
of the actions that have been performed on each reviewable.
2025-11-17 15:45:33 +11:00

28 lines
850 B
Ruby

# frozen_string_literal: true
class ReviewableActionLog < ActiveRecord::Base
belongs_to :reviewable
belongs_to :performed_by, class_name: "User"
validates :action_key, :status, :performed_by_id, presence: true
enum :status, Reviewable.statuses.dup, prefix: :status, scopes: false
end
# == Schema Information
#
# Table name: reviewable_action_logs
#
# id :bigint not null, primary key
# reviewable_id :bigint not null
# action_key :string not null
# status :integer not null
# performed_by_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_reviewable_action_logs_on_performed_by_id (performed_by_id)
# index_reviewable_action_logs_on_reviewable_id (reviewable_id)
#