bb8f2520b4
We request Gitaly in a N+1 manner to build discussion diffs. Once the diffs are from different revisions, it's hard to make a single request to the service in order to build the whole response. With this change we solve this problem and simplify a lot fetching this piece of info.
9 lines
195 B
Ruby
9 lines
195 B
Ruby
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
|