summaryrefslogtreecommitdiff
path: root/app/models/concerns/diff_file.rb
blob: 47ea14163dc4ba2adce340b29ae1aa4ef09eb6c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

module DiffFile
  extend ActiveSupport::Concern

  def to_hash
    keys = Gitlab::Git::Diff::SERIALIZE_KEYS - [:diff]

    as_json(only: keys).merge(diff: diff).with_indifferent_access
  end
end