diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-05-19 18:30:38 -0400 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-05-24 16:51:43 -0400 |
commit | dac9b4212d700272160dff1e0a86c20cb72afedd (patch) | |
tree | f413722e3bfdedffef45f6c9f0f2bc50b571120e /app/finders | |
parent | 45e516b8174c174951a97438c83fd659782e2347 (diff) | |
download | gitlab-ce-dac9b4212d700272160dff1e0a86c20cb72afedd.tar.gz |
Fix outer join when filtering milestonesissue_15221_2
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 0e3dfa74ac4..8ed3ccf1c02 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -250,12 +250,12 @@ class IssuableFinder def by_milestone(items) if milestones? if filter_by_no_milestone? - items = items.where(milestone_id: [-1, nil]) + items = items.left_joins_milestones.where(milestone_id: [-1, nil]) elsif filter_by_upcoming_milestone? upcoming_ids = Milestone.upcoming_ids_by_projects(projects) items = items.left_joins_milestones.where(milestone_id: upcoming_ids) else - items = items.left_joins_milestones.where(milestones: { title: params[:milestone_title] }) + items = items.with_milestone(params[:milestone_title]) if projects items = items.where(milestones: { project_id: projects }) |