From acd66ca6e23dbdefcb99570efc3c629655679061 Mon Sep 17 00:00:00 2001 From: J Guthrie Date: Wed, 13 Mar 2019 12:47:47 +0000 Subject: [PATCH] Raise error when note has no comments --- app/controllers/browse_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 0fccbb506b..979cd7b19c 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -84,6 +84,8 @@ def note else @note = Note.visible.find(params[:id]) @note_comments = @note.comments + + raise ActiveRecord::RecordNotFound if @note.comments.empty? end rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found