Sort specific keys as integers

This is actually logic from reporting, but there's no way to discover
which keys are used to fix the sorting.
pull/6827/head
Oliver Günther 8 years ago
parent 4de3d1f557
commit 2a01c7294e
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 1
      lib/report/query_utils.rb

@ -226,6 +226,7 @@ module Report::QueryUtils
def map_field(key, value) def map_field(key, value)
case key.to_s case key.to_s
when 'singleton_value', /_id$/ then convert_unless_nil(value) { |v| v.to_i } when 'singleton_value', /_id$/ then convert_unless_nil(value) { |v| v.to_i }
when 'work_package_id', 'tweek', 'tmonth', 'tweek' then value.to_i
else convert_unless_nil(value) { |v| v.to_s } else convert_unless_nil(value) { |v| v.to_s }
end end
end end

Loading…
Cancel
Save