summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-31 19:00:45 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-31 19:00:45 +0300
commit26323046fda07b2353ee427afcd0253cea935047 (patch)
tree1497d3e2d9eb52a7c33937c815d6a2579bbb7808 /app/models/commit.rb
parent9dc644635f99dffa26555eeb1c92f988221ccb6a (diff)
downloadgitlab-ce-26323046fda07b2353ee427afcd0253cea935047.tar.gz
Decorate Gitlab::Git::Commit with Commit
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 0164ae663be..ea5b451b28f 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -10,12 +10,20 @@ class Commit
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