diff options
| author | Douwe Maan <douwe@gitlab.com> | 2015-04-21 18:38:26 +0200 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2015-04-24 12:31:16 +0200 |
| commit | 889832578afcf668a15deca1fe3c84b9498bcd1d (patch) | |
| tree | 529e37d024c2a96f0890fe648a3c1ae663b42540 /app/models/note.rb | |
| parent | 0db79443eeaca358f74793f0dafe52f52c5b4497 (diff) | |
| download | gitlab-ce-889832578afcf668a15deca1fe3c84b9498bcd1d.tar.gz | |
Fix small issues.
Diffstat (limited to 'app/models/note.rb')
| -rw-r--r-- | app/models/note.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index f2a9680ff57..cbce6786683 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -238,7 +238,7 @@ class Note < ActiveRecord::Base # Determine whether or not a cross-reference note already exists. def cross_reference_exists?(noteable, mentioner) - gfm_reference = mentioner_gfm_ref(noteable, mentioner, nil) + gfm_reference = mentioner_gfm_ref(noteable, mentioner, true) notes = if noteable.is_a?(Commit) where(commit_id: noteable.id, noteable_type: 'Commit') else @@ -271,12 +271,12 @@ class Note < ActiveRecord::Base # Prepend the mentioner's namespaced project path to the GFM reference for # cross-project references. For same-project references, return the # unmodified GFM reference. - def mentioner_gfm_ref(noteable, mentioner, mentioner_project = mentioner.project) - if mentioner.is_a?(Commit) && mentioner_project.nil? + def mentioner_gfm_ref(noteable, mentioner, cross_reference = false) + if mentioner.is_a?(Commit) && cross_reference return mentioner.gfm_reference.sub('commit ', 'commit %') end - full_gfm_reference(mentioner_project, noteable.project, mentioner) + full_gfm_reference(mentioner.project, noteable.project, mentioner) end # Return the +mentioner+ GFM reference. If the mentioner and noteable |
