OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#36743] attempt to include != operator
Tobias Dillmann837ab4933c74
diff --git a/app/models/queries/work_packages/filter/ancestor_filter.rb b/app/models/queries/work_packages/filter/ancestor_filter.rbindex 5118a4a9ef1..1e09eb8f698 100644--- a/app/models/queries/work_packages/filter/ancestor_filter.rb+++ b/app/models/queries/work_packages/filter/ancestor_filter.rb@@ -32,7 +32,6 @@ class Queries::WorkPackages::Filter::AncestorFilter <Queries::WorkPackages::Filter::WorkPackageFilterinclude ::Queries::WorkPackages::Filter::FilterForWpMixin- # TODO all of the below is just copied. Change!def relation_type# While this is not a relation (in the sense of it being stored in a different database table) we still# want it to be used same as every other relation filter.@@ -40,11 +39,19 @@ class Queries::WorkPackages::Filter::AncestorFilter <enddef apply_to(_query_scope)+ operator = operator_strategy.symbol++ condition = if operator == "="+ "WHERE id IN (:ids)"+ else+ "WHERE id NOT IN (:ids)"+ end+cte = <<~SQL.squishWITH RECURSIVE descendants AS (SELECT idFROM work_packages- WHERE id IN (:ids)+ #{condition}UNION ALLSELECT wp.idFROM work_packages wp@@ -61,6 +68,6 @@ class Queries::WorkPackages::Filter::AncestorFilter <enddef where- "1 = 1"+ "1=1"endend