Project

General

Profile

Patch #35396 » issues_with_base_scope_v2.patch

Alexander Meindl, 2021-06-10 19:06

View differences:

app/models/issue_query.rb
355 355
      order_option << "#{Issue.table_name}.id DESC"
356 356
    end
357 357

  
358
    scope = Issue.visible.
359
      joins(:status, :project).
358
    scope = base_scope.
360 359
      preload(:priority).
361
      where(statement).
362 360
      includes(([:status, :project] + (options[:include] || [])).uniq).
363 361
      where(options[:conditions]).
364 362
      order(order_option).
......
405 403
      order_option << "#{Issue.table_name}.id DESC"
406 404
    end
407 405

  
408
    Issue.visible.
409
      joins(:status, :project).
410
      where(statement).
406
    base_scope.
411 407
      includes(([:status, :project] + (options[:include] || [])).uniq).
412 408
      references(([:status, :project] + (options[:include] || [])).uniq).
413 409
      where(options[:conditions]).
(2-2/2)