diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-28 20:09:36 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-28 20:09:36 -0600 |
commit | 1c2eefef3f67d9d221b6465ec77907940732e789 (patch) | |
tree | 36c66b062f5d328ea3cd41aea5d8ea483f08efe8 /app/controllers/projects/notes_controller.rb | |
parent | 6d9715d8777265737c076abe06362d2a8e9e498d (diff) | |
download | gitlab-ce-1c2eefef3f67d9d221b6465ec77907940732e789.tar.gz |
Backend tweaks
Diffstat (limited to 'app/controllers/projects/notes_controller.rb')
-rw-r--r-- | app/controllers/projects/notes_controller.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb index 59b8e88c8d7..027a2d7dcb2 100644 --- a/app/controllers/projects/notes_controller.rb +++ b/app/controllers/projects/notes_controller.rb @@ -72,11 +72,11 @@ class Projects::NotesController < Projects::ApplicationController note.resolve!(current_user) - discussion = note.noteable.discussions.find { |d| d.id == note.discussion_id } || render_404 + discussion = note.discussion render json: { resolved_by: note.resolved_by.try(:name), - updated_html: view_to_html_string('discussions/_headline', discussion: discussion) + discussion_headline_html: (view_to_html_string('discussions/_headline', discussion: discussion) if discussion) } end @@ -85,10 +85,10 @@ class Projects::NotesController < Projects::ApplicationController note.unresolve! - discussion = note.noteable.discussions.find { |d| d.id == note.discussion_id } || render_404 + discussion = note.discussion render json: { - updated_html: view_to_html_string('discussions/_headline', discussion: discussion) + discussion_headline_html: (view_to_html_string('discussions/_headline', discussion: discussion) if discussion) } end @@ -164,7 +164,7 @@ class Projects::NotesController < Projects::ApplicationController } if note.diff_note? - discussion = Discussion.new([note]) + discussion = note.as_discussion attrs.merge!( diff_discussion_html: diff_discussion_html(discussion), |