diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-31 19:00:45 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-31 19:00:45 +0300 |
commit | 26323046fda07b2353ee427afcd0253cea935047 (patch) | |
tree | 1497d3e2d9eb52a7c33937c815d6a2579bbb7808 /app/models | |
parent | 9dc644635f99dffa26555eeb1c92f988221ccb6a (diff) | |
download | gitlab-ce-26323046fda07b2353ee427afcd0253cea935047.tar.gz |
Decorate Gitlab::Git::Commit with Commit
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/commit.rb | 8 |
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 |