diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-05-31 14:22:34 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-05-31 14:22:34 +0300 |
commit | 7f32b9d7b58ec9b5668595cc92e86a402db172cd (patch) | |
tree | 074a687a637c5ce6100592b4bf050a1c3dda7245 /app | |
parent | 3f6fffe95205607fa393f1221a628e85283c942c (diff) | |
parent | 1d766bfbdf8f11d176beb99d139edc6150e3f032 (diff) |
Merge branch 'rails5-exists-query' into 'master'
Replace `.exists` with `EXISTS ()`
Closes #46277
See merge request gitlab-org/gitlab-ce!19178
Diffstat (limited to 'app')
-rw-r--r-- | app/services/boards/issues/list_service.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/services/boards/issues/list_service.rb b/app/services/boards/issues/list_service.rb index ac70a99c2c5..5a961ac89e4 100644 --- a/app/services/boards/issues/list_service.rb +++ b/app/services/boards/issues/list_service.rb @@ -63,7 +63,7 @@ module Boards def without_board_labels(issues) return issues unless board_label_ids.any? - issues.where.not(issues_label_links.limit(1).arel.exists) + issues.where.not('EXISTS (?)', issues_label_links.limit(1)) end def issues_label_links @@ -71,10 +71,8 @@ module Boards end def with_list_label(issues) - issues.where( - LabelLink.where("label_links.target_type = 'Issue' AND label_links.target_id = issues.id") - .where("label_links.label_id = ?", list.label_id).limit(1).arel.exists - ) + issues.where('EXISTS (?)', LabelLink.where("label_links.target_type = 'Issue' AND label_links.target_id = issues.id") + .where("label_links.label_id = ?", list.label_id).limit(1)) end end end |