debian-mirror-gitlab/app/models/approval.rb
2021-02-22 17:27:13 +05:30

13 lines
317 B
Ruby

# frozen_string_literal: true
class Approval < ApplicationRecord
include CreatedAtFilterable
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