新增: 合并请求审核model

This commit is contained in:
2022-06-29 17:16:29 +08:00
parent e76503ae26
commit 76cc185a1d
9 changed files with 120 additions and 0 deletions

27
app/models/review.rb Normal file
View File

@@ -0,0 +1,27 @@
# == Schema Information
#
# Table name: reviews
#
# id :integer not null, primary key
# issue_id :integer
# reviewer_id :integer
# content :text(65535)
# commit_id :string(255)
# status :integer default("0")
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_reviews_on_issue_id (issue_id)
# index_reviews_on_reviewer_id (reviewer_id)
#
class Review < ApplicationRecord
belongs_to :issue
belongs_to :reviewer, class_name: 'User', foreign_key: :reviewer_id
has_one :journal, dependent: :destroy
enum status: {common: 0, approved: 1, rejected: 2}
end