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

merge_request.rb « models « user_mentions « background_migration « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6b52afea17c68852bc7044be4fcd5e19021511bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# frozen_string_literal: true
# rubocop:disable Style/Documentation

module Gitlab
  module BackgroundMigration
    module UserMentions
      module Models
        class MergeRequest < ActiveRecord::Base
          include EachBatch
          include Concerns::IsolatedMentionable
          include CacheMarkdownField
          include Concerns::MentionableMigrationMethods

          attr_mentionable :title, pipeline: :single_line
          attr_mentionable :description
          cache_markdown_field :title, pipeline: :single_line
          cache_markdown_field :description, issuable_state_filter_enabled: true

          self.table_name = 'merge_requests'

          belongs_to :author, class_name: "User"
          belongs_to :target_project, class_name: "Project"
          belongs_to :source_project, class_name: "Project"

          alias_attribute :project, :target_project

          def self.user_mention_model
            Gitlab::BackgroundMigration::UserMentions::Models::MergeRequestUserMention
          end

          def user_mention_model
            self.class.user_mention_model
          end

          def user_mention_resource_id
            id
          end

          def user_mention_note_id
            'NULL'
          end
        end
      end
    end
  end
end