diff options
Diffstat (limited to 'app/controllers/notes_controller.rb')
-rw-r--r-- | app/controllers/notes_controller.rb | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index a2638d9597c..1c997e380a0 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -40,25 +40,6 @@ class NotesController < ApplicationController protected def notes - @notes = case params[:target_type] - when "commit" - then project.commit_notes(project.commit((params[:target_id]))).fresh.limit(20) - when "snippet" - then project.snippets.find(params[:target_id]).notes - when "wall" - then project.common_notes.order("created_at DESC").fresh.limit(50) - when "issue" - then project.issues.find(params[:target_id]).notes.inc_author.order("created_at DESC").limit(20) - when "merge_request" - then project.merge_requests.find(params[:target_id]).notes.inc_author.order("created_at DESC").limit(20) - end - - @notes = if params[:last_id] - @notes.where("id > ?", params[:last_id]) - elsif params[:first_id] - @notes.where("id < ?", params[:first_id]) - else - @notes - end + @notes = NotesLoad.new(project, current_user, params).execute end end |