summaryrefslogtreecommitdiff
path: root/app/controllers/snippets/notes_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/snippets/notes_controller.rb')
-rw-r--r--app/controllers/snippets/notes_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/snippets/notes_controller.rb b/app/controllers/snippets/notes_controller.rb
index 8532257cb8d..8a4e8edbf3c 100644
--- a/app/controllers/snippets/notes_controller.rb
+++ b/app/controllers/snippets/notes_controller.rb
@@ -23,7 +23,7 @@ class Snippets::NotesController < ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def snippet
- PersonalSnippet.find_by(id: params[:snippet_id])
+ @snippet ||= PersonalSnippet.find_by(id: params[:snippet_id])
end
# rubocop: enable CodeReuse/ActiveRecord
alias_method :noteable, :snippet