Skip to content

Commit

Permalink
Merge pull request #1 from znyak/znyak-patch-dbms
Browse files Browse the repository at this point in the history
fixed for mssql and pg
  • Loading branch information
znyak authored Aug 18, 2021
2 parents 705965b + 5bf6ae0 commit fa827f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/models/wbs_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
Expand Down

0 comments on commit fa827f6

Please sign in to comment.