diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-06-15 13:06:49 +0100 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-06-28 11:32:34 +0100 |
commit | 34f57b462bc14ad194cf890a4585d403bdbde55c (patch) | |
tree | 6edd502ba8b3c0bca4e8b77492ac0936d3c52cf2 /app/finders/todos_finder.rb | |
parent | 8e8eb97861a8a93625590274af8382e9333cbf91 (diff) | |
download | gitlab-ce-34f57b462bc14ad194cf890a4585d403bdbde55c.tar.gz |
Fix current feature related specs
Diffstat (limited to 'app/finders/todos_finder.rb')
-rw-r--r-- | app/finders/todos_finder.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/finders/todos_finder.rb b/app/finders/todos_finder.rb index c358f23f541..5a4c5767be5 100644 --- a/app/finders/todos_finder.rb +++ b/app/finders/todos_finder.rb @@ -78,11 +78,14 @@ class TodosFinder end def project + return nil if @project&.pending_delete? return @project if defined?(@project) if project? @project = Project.find(params[:project_id]) + @project = nil if @project.pending_delete? + unless Ability.allowed?(current_user, :read_project, @project) @project = nil end @@ -95,7 +98,7 @@ class TodosFinder def projects(items) item_project_ids = items.reorder(nil).select(:project_id) - ProjectsFinder.new(current_user: current_user, project_ids_relation: item_project_ids).execute + ProjectsFinder.new(current_user: current_user, project_ids_relation: item_project_ids).execute.without_deleted end def type? |