# == Schema Information
#
# Table name: pr_reviews
#
#  id              :integer          not null, primary key
#  reviewer_id     :integer
#  content         :text(65535)
#  commit_id       :string(255)
#  status          :integer          default("0")
#  created_at      :datetime         not null
#  updated_at      :datetime         not null
#  pull_request_id :integer
#
# Indexes
#
#  index_pr_reviews_on_pull_request_id  (pull_request_id)
#  index_pr_reviews_on_reviewer_id      (reviewer_id)
#

class Review < ApplicationRecord
  self.table_name = "pr_reviews"

  belongs_to :pull_request
  belongs_to :reviewer, class_name: 'User', foreign_key: :reviewer_id
  has_one :journal, dependent: :destroy

  enum status: {common: 0, approved: 1, rejected: 2} 
end
