Commit f3d6d556 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'improve_in_epics_scope' into 'master'

Improve in_epics scope

See merge request gitlab-org/gitlab!40203
parents 375bdf66 83749c6a
......@@ -23,10 +23,7 @@ module EE
scope :order_weight_asc, -> { reorder ::Gitlab::Database.nulls_last_order('weight') }
scope :no_epic, -> { left_outer_joins(:epic_issue).where(epic_issues: { epic_id: nil }) }
scope :any_epic, -> { joins(:epic_issue) }
scope :in_epics, ->(epics) do
issue_ids = EpicIssue.where(epic_id: epics).select(:issue_id)
id_in(issue_ids)
end
scope :in_epics, ->(epics) { joins(:epic_issue).where(epic_issues: { epic_id: epics }) }
scope :no_iteration, -> { where(sprint_id: nil) }
scope :any_iteration, -> { where.not(sprint_id: nil) }
scope :in_iterations, ->(iterations) { where(sprint_id: iterations) }
......
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