Welcome to mirror list, hosted at ThFree Co, Russian Federation.

approval.rb « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ecc15077c8dfbac7e8925c6bef899cc327820e98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class Approval < ApplicationRecord
  include CreatedAtFilterable
  include Importable
  include ShaAttribute

  belongs_to :user
  belongs_to :merge_request

  sha_attribute :patch_id_sha

  validates :merge_request_id, presence: true, unless: :importing?
  validates :user_id, presence: true, uniqueness: { scope: [:merge_request_id] }

  scope :with_user, -> { joins(:user) }
end