2020-08-30 20:10:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class MergeRequestReviewer < ApplicationRecord
|
2021-02-02 07:10:15 -05:00
|
|
|
enum state: {
|
|
|
|
unreviewed: 0,
|
|
|
|
reviewed: 1
|
|
|
|
}
|
|
|
|
|
|
|
|
validates :state,
|
|
|
|
presence: true,
|
|
|
|
inclusion: { in: MergeRequestReviewer.states.keys }
|
|
|
|
|
2020-08-30 20:10:37 -04:00
|
|
|
belongs_to :merge_request
|
2020-11-23 13:09:14 -05:00
|
|
|
belongs_to :reviewer, class_name: 'User', foreign_key: :user_id, inverse_of: :merge_request_reviewers
|
2020-08-30 20:10:37 -04:00
|
|
|
end
|