Class: MergeRequestContextCommitDiffFile

Inherits:
ApplicationRecord show all
Extended by:
SuppressCompositePrimaryKeyWarning
Includes:
DiffFile, Gitlab::EncodingHelper, ShaAttribute
Defined in:
app/models/merge_request_context_commit_diff_file.rb

Constant Summary

Constants included from Gitlab::EncodingHelper

Gitlab::EncodingHelper::ENCODING_CONFIDENCE_THRESHOLD, Gitlab::EncodingHelper::ESCAPED_CHARS, Gitlab::EncodingHelper::UNICODE_REPLACEMENT_CHARACTER

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DiffFile

#to_hash

Methods included from Gitlab::EncodingHelper

#binary_io, #detect_binary?, #detect_encoding, #detect_libgit2_binary?, #encode!, #encode_binary, #encode_utf8, #encode_utf8_no_detect, #encode_utf8_with_replacement_character, #unquote_path

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Class Method Details

.bulk_insert(*args) ⇒ Object

create MergeRequestContextCommitDiffFile by given diff file record(s)


16
17
18
# File 'app/models/merge_request_context_commit_diff_file.rb', line 16

def self.bulk_insert(*args)
  ApplicationRecord.legacy_bulk_insert('merge_request_context_commit_diff_files', *args) # rubocop:disable Gitlab/BulkInsert
end

Instance Method Details

#pathObject


20
21
22
# File 'app/models/merge_request_context_commit_diff_file.rb', line 20

def path
  new_path.presence || old_path
end