Module: CachedCommit

Extended by:
ActiveSupport::Concern
Included in:
MergeRequestContextCommit, MergeRequestDiffCommit
Defined in:
app/models/concerns/cached_commit.rb

Instance Method Summary collapse

Instance Method Details

#parent_idsObject

We don't save these, because they would need a table or a serialised field. They aren't used anywhere, so just pretend the commit has no parents.


14
15
16
# File 'app/models/concerns/cached_commit.rb', line 14

def parent_ids
  []
end

#to_hashObject


6
7
8
9
10
# File 'app/models/concerns/cached_commit.rb', line 6

def to_hash
  Gitlab::Git::Commit::SERIALIZE_KEYS.each_with_object({}) do |key, hash|
    hash[key] = public_send(key) # rubocop:disable GitlabSecurity/PublicSend
  end
end