debian-mirror-gitlab/app/models/approval.rb

12 lines
286 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
class Approval < ApplicationRecord
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