From 042cf15b6f6dae6a6e3f760f93a3ad0f7ff486ea Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 18 Jul 2017 03:26:41 +0800 Subject: Cache Note#notable for commits and fix tests --- app/models/note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/note.rb') diff --git a/app/models/note.rb b/app/models/note.rb index 3d39047d32f..d0e3bc0bfed 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -190,7 +190,7 @@ class Note < ActiveRecord::Base # override to return commits, which are not active record def noteable if for_commit? - project.commit(commit_id) + @commit ||= project.commit(commit_id) else super end -- cgit v1.2.1