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

#referenced_byObject

These are not saved



19
20
21
# File 'app/models/concerns/cached_commit.rb', line 19

def referenced_by
  []
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.index_with do |key|
    public_send(key) # rubocop:disable GitlabSecurity/PublicSend
  end
end