gitlab-org--gitlab-foss/app/models/approval.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
359 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Approval < ApplicationRecord
include CreatedAtFilterable
include Importable
belongs_to :user
belongs_to :merge_request
validates :merge_request_id, presence: true, unless: :importing?
validates :user_id, presence: true, uniqueness: { scope: [:merge_request_id] }
scope :with_user, -> { joins(:user) }
end