Skip to content
Snippets Groups Projects
Commit 4ecc10fa authored by DJ Mountney's avatar DJ Mountney
Browse files

Reduce the filters on the todos joins project query by being explicit about the join

parent c3e923c4
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -23,7 +23,13 @@ class TodosFinder
end
 
def execute
items = current_user.todos.joins(:project).where(projects: { pending_delete: false })
items = current_user.todos
# Filter out todos linked to project pending deletion
items = items.joins(
'INNER JOIN projects ON projects.id = todos.project_id AND projects.pending_delete = false'
)
items = by_action_id(items)
items = by_author(items)
items = by_project(items)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment