From 5bf6ae0b404b6e0aab9427ce51ef7d20ec0243d6 Mon Sep 17 00:00:00 2001 From: znyak Date: Wed, 18 Aug 2021 16:54:53 +0200 Subject: [PATCH] fixed for mssql and pg mssql and pg force a boolean expression for OR, hence ()!=0 on line 44 mssql and pg need a join expression, moved previous line 35 into 34 --- app/models/wbs_query.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/wbs_query.rb b/app/models/wbs_query.rb index ccf9815..5106288 100644 --- a/app/models/wbs_query.rb +++ b/app/models/wbs_query.rb @@ -31,8 +31,7 @@ def excluded_issues .select(:id) .visible .where(project_id: @project.id) - .joins("INNER JOIN (#{subquery.to_sql}) parent") - .where("#{Issue.table_name}.root_id = parent.root_id") + .joins("INNER JOIN (#{subquery.to_sql}) parent on #{Issue.table_name}.root_id = parent.root_id") .where("#{Issue.table_name}.lft >= parent.lft") .where("#{Issue.table_name}.rgt <= parent.rgt") end @@ -42,7 +41,7 @@ def excluded_issues def excluded_trackers Tracker.select(:id) .where( - "#{Tracker.table_name}.id IN (?) OR #{Tracker.table_name}.fields_bits & ?", + "#{Tracker.table_name}.id IN (?) OR (#{Tracker.table_name}.fields_bits & ?) != 0", RedmineWbs.excluded_tracker_ids, RedmineWbs.required_core_field_bits )