# == Schema Information
#
# Table name: 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_reviews_on_pull_request_id  (pull_request_id)
#  index_reviews_on_reviewer_id      (reviewer_id)
#

class Review < ApplicationRecord

  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
