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

cached_commit.rb « concerns « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 74120f49d01677f030a9816ce4066f3e14f56fc7 (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
# frozen_string_literal: true

module CachedCommit
  extend ActiveSupport::Concern

  def to_hash
    Gitlab::Git::Commit::SERIALIZE_KEYS.index_with do |key|
      public_send(key) # rubocop:disable GitlabSecurity/PublicSend
    end
  end

  # 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.
  def parent_ids
    []
  end

  # These are not saved
  def referenced_by
    []
  end

  def extended_trailers
    {}
  end
end