2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-01-03 11:03:01 -06:00
|
|
|
class ReviewableHistory < ActiveRecord::Base
|
|
|
|
belongs_to :reviewable
|
2023-01-09 06:20:10 -06:00
|
|
|
belongs_to :created_by, class_name: "User"
|
2019-01-03 11:03:01 -06:00
|
|
|
|
2023-01-09 06:20:10 -06:00
|
|
|
enum status: { pending: 0, approved: 1, rejected: 2, ignored: 3, deleted: 4 }
|
2019-01-03 11:03:01 -06:00
|
|
|
|
2021-12-08 11:12:24 -06:00
|
|
|
alias_attribute :type, :reviewable_history_type
|
2023-01-09 06:20:10 -06:00
|
|
|
enum type: { created: 0, transitioned: 1, edited: 2, claimed: 3, unclaimed: 4 }
|
2019-01-03 11:03:01 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: reviewable_histories
|
|
|
|
#
|
2019-05-02 17:34:12 -05:00
|
|
|
# id :bigint not null, primary key
|
2019-01-03 11:03:01 -06:00
|
|
|
# reviewable_id :integer not null
|
|
|
|
# reviewable_history_type :integer not null
|
|
|
|
# status :integer not null
|
|
|
|
# created_by_id :integer not null
|
|
|
|
# edited :json
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
#
|
|
|
|
# Indexes
|
|
|
|
#
|
|
|
|
# index_reviewable_histories_on_created_by_id (created_by_id)
|
|
|
|
# index_reviewable_histories_on_reviewable_id (reviewable_id)
|
|
|
|
#
|