diff options
| author | Zeger-Jan van de Weg <mail@zjvandeweg.nl> | 2015-11-11 13:07:02 +0100 |
|---|---|---|
| committer | Zeger-Jan van de Weg <mail@zjvandeweg.nl> | 2015-11-11 13:07:02 +0100 |
| commit | 7e4a7d9ecc02db06c568a0de47e096edbdc1224b (patch) | |
| tree | 701af1b1789f17950a22a19df4cf8f69d3beb173 /app/models/commit.rb | |
| parent | 3f08e4b186bd02b37f34ccf1bc641a95f9d865ce (diff) | |
| parent | dfa09789061bbd3891c17ebbcc23f7bd6b95336c (diff) | |
| download | gitlab-ce-7e4a7d9ecc02db06c568a0de47e096edbdc1224b.tar.gz | |
Merge branch 'master' into copying-file-seen-as-licence
Diffstat (limited to 'app/models/commit.rb')
| -rw-r--r-- | app/models/commit.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index d5c50013525..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,10 +189,6 @@ class Commit @raw.short_id(7) end - def parents - @parents ||= Commit.decorate(super, project) - end - def ci_commit project.ci_commit(sha) end |
