2020-07-01 17:08:51 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Approval < ApplicationRecord
|
2020-12-08 19:09:42 -05:00
|
|
|
include CreatedAtFilterable
|
|
|
|
|
2020-07-01 17:08:51 -04:00
|
|
|
belongs_to :user
|
|
|
|
belongs_to :merge_request
|
|
|
|
|
|
|
|
validates :merge_request_id, presence: true
|
|
|
|
validates :user_id, presence: true, uniqueness: { scope: [:merge_request_id] }
|
|
|
|
|
|
|
|
scope :with_user, -> { joins(:user) }
|
|
|
|
end
|