diff options
| author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-10-10 12:06:30 +0200 |
|---|---|---|
| committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-10-10 12:06:30 +0200 |
| commit | 3f72af9994554c66a51cdfb4302e48da0edd043a (patch) | |
| tree | 9abd52eb69954b9921ac71f9b781f6f5f4639181 /app/models/note.rb | |
| parent | dda852a0d5c9e684b82cf20380d2b26da1798ecb (diff) | |
| download | gitlab-ce-3f72af9994554c66a51cdfb4302e48da0edd043a.tar.gz | |
Make notes for merge requests include commit notes and add helpers
Diffstat (limited to 'app/models/note.rb')
| -rw-r--r-- | app/models/note.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index 65b20fe0b11..ae51e486675 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -49,7 +49,7 @@ class Note < ActiveRecord::Base end def target - if noteable_type == "Commit" + if commit? project.commit(noteable_id) else noteable @@ -82,6 +82,10 @@ class Note < ActiveRecord::Base noteable_type == "Commit" end + def line_note? + line_code.present? + end + def commit_author @commit_author ||= project.users.find_by_email(target.author_email) || |
