Defect #23839 » fix_duplicated_order_by_columns_v2.patch
| app/models/issue_query.rb Thu Sep 15 11:03:45 2016 +0000 → app/models/issue_query.rb Thu Sep 22 14:23:58 2016 +0200 | ||
|---|---|---|
|
# Returns the issues ids
|
||
|
def issue_ids(options={})
|
||
|
order_option = [group_by_sort_order, options[:order]].flatten.reject(&:blank?)
|
||
|
# Apply Options sort order in case of duplicated column, if there are group_by sorted columns
|
||
|
if group_by_sort_order
|
||
|
group_by_with_options_sort_order = group_by_sort_order.map { |a|
|
||
|
i = options[:order].find_index { |b| (b.reverse.split(" ", 2).last == a.reverse.split(" ", 2).last) }
|
||
|
i.nil? ? a : options[:order][i]
|
||
|
}
|
||
|
order_option = [group_by_with_options_sort_order, options[:order]].flatten.reject(&:blank?).uniq
|
||
|
else
|
||
|
order_option = [options[:order]].flatten.reject(&:blank?)
|
||
|
end
|
||
|
Issue.visible.
|
||
|
joins(:status, :project).
|
||
- « Previous
- 1
- 2
- Next »