blob: 9ded44fe42556993c5ca7942d623bc3a32d2fd50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# 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
|