summaryrefslogtreecommitdiff
path: root/app/helpers/notes_helper.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-06 18:18:53 -0500
committerDouwe Maan <douwe@selenight.nl>2017-04-08 14:37:46 -0500
commita8339fe1aa95d489e00cb0b79a20557d711639ec (patch)
tree941fafaa5709c333a06981b5068f151fa0c56eb0 /app/helpers/notes_helper.rb
parentf112f81d3d463a81c8b5e9225d5e9bb40e82abe8 (diff)
downloadgitlab-ce-a8339fe1aa95d489e00cb0b79a20557d711639ec.tar.gz
Fix views after rebase
Diffstat (limited to 'app/helpers/notes_helper.rb')
-rw-r--r--app/helpers/notes_helper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 6f4ba79b80b..c831f89dc19 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -61,7 +61,7 @@ module NotesHelper
end
def discussion_diff_path(discussion)
- if discussion.for_merge_request?
+ if discussion.for_merge_request? && discussion.diff_discussion?
if discussion.active?
# Without a diff ID, the link always points to the latest diff version
diff_id = nil
@@ -75,7 +75,9 @@ module NotesHelper
diffs_namespace_project_merge_request_path(discussion.project.namespace, discussion.project, discussion.noteable, diff_id: diff_id, anchor: discussion.line_code)
elsif discussion.for_commit?
- namespace_project_commit_path(discussion.project.namespace, discussion.project, discussion.noteable, anchor: discussion.line_code)
+ anchor = discussion.line_code if discussion.diff_discussion?
+
+ namespace_project_commit_path(discussion.project.namespace, discussion.project, discussion.noteable, anchor: anchor)
end
end
end