2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class MergeRequestContextCommitDiffFile < ApplicationRecord
|
2021-03-11 19:13:27 +05:30
|
|
|
extend SuppressCompositePrimaryKeyWarning
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
include Gitlab::EncodingHelper
|
|
|
|
include ShaAttribute
|
|
|
|
include DiffFile
|
|
|
|
|
|
|
|
belongs_to :merge_request_context_commit, inverse_of: :diff_files
|
|
|
|
|
|
|
|
sha_attribute :sha
|
|
|
|
alias_attribute :id, :sha
|
|
|
|
|
|
|
|
# create MergeRequestContextCommitDiffFile by given diff file record(s)
|
|
|
|
def self.bulk_insert(*args)
|
2021-12-11 22:18:48 +05:30
|
|
|
ApplicationRecord.legacy_bulk_insert('merge_request_context_commit_diff_files', *args) # rubocop:disable Gitlab/BulkInsert
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
2021-06-08 01:23:25 +05:30
|
|
|
|
|
|
|
def path
|
|
|
|
new_path.presence || old_path
|
|
|
|
end
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|