mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 07:48:12 +08:00
26fe047724
This is the first patch of many to replace our custom enums in Ruby by the ones provided by `ActiveRecord`.
43 lines
1.0 KiB
Ruby
43 lines
1.0 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
class ReviewableHistory < ActiveRecord::Base
|
|
belongs_to :reviewable
|
|
belongs_to :created_by, class_name: 'User'
|
|
|
|
enum status: {
|
|
pending: 0,
|
|
approved: 1,
|
|
rejected: 2,
|
|
ignored: 3,
|
|
deleted: 4
|
|
}
|
|
|
|
alias_attribute :type, :reviewable_history_type
|
|
enum type: {
|
|
created: 0,
|
|
transitioned: 1,
|
|
edited: 2,
|
|
claimed: 3,
|
|
unclaimed: 4
|
|
}
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: reviewable_histories
|
|
#
|
|
# id :bigint not null, primary key
|
|
# 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)
|
|
#
|