diff options
author | Jan-Gerd Tenberge <janten@gmail.com> | 2015-10-22 21:43:17 +0200 |
---|---|---|
committer | Jan-Gerd Tenberge <janten@gmail.com> | 2015-10-22 21:43:17 +0200 |
commit | b5c19bcc4d02fd498bc95d70c39bd88ec9cdda4b (patch) | |
tree | 6eaed47ca3b65dbd622813497b18902666d23d68 /app/models/commit.rb | |
parent | b32bb377993fb0224ed3bd9294d752d1a82b2ef9 (diff) | |
parent | a7174efaec77e9408900336b5941d9cca1f82ccf (diff) | |
download | gitlab-ce-b5c19bcc4d02fd498bc95d70c39bd88ec9cdda4b.tar.gz |
Fix merge error
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index aff329d71fa..492f6be1ce3 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -2,13 +2,13 @@ class Commit extend ActiveModel::Naming include ActiveModel::Conversion - include Mentionable include Participable + include Mentionable include Referable include StaticModel attr_mentionable :safe_message - participant :author, :committer, :notes, :mentioned_users + participant :author, :committer, :notes attr_accessor :project @@ -164,6 +164,14 @@ class Commit @committer ||= User.find_by_any_email(committer_email) end + def parents + @parents ||= parent_ids.map { |id| project.commit(id) } + end + + def parent + @parent ||= project.commit(self.parent_id) if self.parent_id + end + def notes project.notes.for_commit_id(self.id) end @@ -181,7 +189,11 @@ class Commit @raw.short_id(7) end - def parents - @parents ||= Commit.decorate(super, project) + def ci_commit + project.ci_commit(sha) + end + + def status + ci_commit.try(:status) || :not_found end end |