@@ -323,7 +323,7 class IssueQuery < Query | |||
|
323 | 323 | def issues(options={}) |
|
324 | 324 | order_option = [group_by_sort_order, options[:order]].flatten.reject(&:blank?) |
|
325 | 325 | |
|
326 |
|
|
|
326 | scope = Issue.visible. | |
|
327 | 327 | joins(:status, :project). |
|
328 | 328 | where(statement). |
|
329 | 329 | includes(([:status, :project] + (options[:include] || [])).uniq). |
@@ -331,8 +331,13 class IssueQuery < Query | |||
|
331 | 331 | order(order_option). |
|
332 | 332 | joins(joins_for_order_statement(order_option.join(','))). |
|
333 | 333 | limit(options[:limit]). |
|
334 |
offset(options[:offset]) |
|
|
335 | all | |
|
334 | offset(options[:offset]) | |
|
335 | ||
|
336 | if has_custom_field_column? | |
|
337 | scope = scope.preload(:custom_values) | |
|
338 | end | |
|
339 | ||
|
340 | issues = scope.all | |
|
336 | 341 | |
|
337 | 342 | if has_column?(:spent_hours) |
|
338 | 343 | Issue.load_visible_spent_hours(issues) |
@@ -449,6 +449,10 class Query < ActiveRecord::Base | |||
|
449 | 449 | column_names && column_names.include?(column.is_a?(QueryColumn) ? column.name : column) |
|
450 | 450 | end |
|
451 | 451 | |
|
452 | def has_custom_field_column? | |
|
453 | columns.any? {|column| column.is_a? QueryCustomFieldColumn} | |
|
454 | end | |
|
455 | ||
|
452 | 456 | def has_default_columns? |
|
453 | 457 | column_names.nil? || column_names.empty? |
|
454 | 458 | end |
General Comments 0
You need to be logged in to leave comments.
Login now