Commit 770ed0f8 authored by Felipe Artur's avatar Felipe Artur

[CE-Backport] Fix board filter when milestone is predefined

parent 003a816a
...@@ -84,6 +84,13 @@ class Milestone < ActiveRecord::Base ...@@ -84,6 +84,13 @@ class Milestone < ActiveRecord::Base
else milestones.active else milestones.active
end end
end end
def predefined?(milestone)
milestone == Any ||
milestone == None ||
milestone == Upcoming ||
milestone == Started
end
end end
def self.reference_prefix def self.reference_prefix
......
...@@ -54,10 +54,11 @@ module Boards ...@@ -54,10 +54,11 @@ module Boards
def without_board_labels(issues) def without_board_labels(issues)
return issues unless board_label_ids.any? return issues unless board_label_ids.any?
issues.where.not( issues.where.not(issues_label_links.limit(1).arel.exists)
LabelLink.where("label_links.target_type = 'Issue' AND label_links.target_id = issues.id") end
.where(label_id: board_label_ids).limit(1).arel.exists
) def issues_label_links
LabelLink.where("label_links.target_type = 'Issue' AND label_links.target_id = issues.id").where(label_id: board_label_ids)
end end
def with_list_label(issues) def with_list_label(issues)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment