2019-03-22 16:51:47 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class MergeRequestAssignee < ApplicationRecord
|
|
|
|
belongs_to :merge_request
|
2020-06-23 15:08:41 +00:00
|
|
|
belongs_to :assignee, class_name: "User", foreign_key: :user_id, inverse_of: :merge_request_assignees
|
2020-01-29 00:08:58 +00:00
|
|
|
|
|
|
|
validates :assignee, uniqueness: { scope: :merge_request_id }
|
2020-06-23 15:08:41 +00:00
|
|
|
|
|
|
|
scope :in_projects, ->(project_ids) { joins(:merge_request).where("merge_requests.target_project_id in (?)", project_ids) }
|
2019-03-22 16:51:47 +00:00
|
|
|
end
|