diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-11-11 14:49:31 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-11-19 13:48:50 +0300 |
commit | e9cd58f5d50a7b5cfc14e08cd9526505e24f1071 (patch) | |
tree | 2c089354f4333fc26aa6cbebfa51e732b045c256 /app/finders | |
parent | c232a0f97f9b724a142c728ebeceba25ef15ab32 (diff) |
Memoize IssuableFinder#projects
Since this method's returned data doesn't change between calls on the
same IssuableFinder instance we can just memoize this similar to the
"project" method.
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 30ec8f60098..15b5d6ab34c 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -77,11 +77,11 @@ class IssuableFinder return @projects if defined?(@projects) if project? - project + @projects = project elsif current_user && params[:authorized_only].presence && !current_user_related? - current_user.authorized_projects + @projects = current_user.authorized_projects else - ProjectsFinder.new.execute(current_user) + @projects = ProjectsFinder.new.execute(current_user) end end |