blob: ea5b451b28fa1a21558280de3fabae230af64515 (
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
27
28
29
30
|
class Commit
include ActiveModel::Conversion
include StaticModel
extend ActiveModel::Naming
# Safe amount of files with diffs in one commit to render
# Used to prevent 500 error on huge commits by suppressing diff
#
DIFF_SAFE_SIZE = 100
attr_accessor :raw
def self.decorate(commits)
commits.map { |c| Commit.new(c) }
end
def initialize(raw_commit)
raise "Nil as raw commit passed" unless raw_commit
@raw = raw_commit
end
def id
@raw.id
end
def method_missing(m, *args, &block)
@raw.send(m, *args, &block)
end
end
|