Merge branch 'release/10.5' into release/10.6

pull/8395/head
ulferts 5 years ago
commit 652ccb02b4
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 4
      app/models/queries/work_packages/columns/custom_field_column.rb
  2. 2
      app/models/query/sums.rb

@ -79,7 +79,7 @@ class Queries::WorkPackages::Columns::CustomFieldColumn < Queries::WorkPackages:
def sum_of(work_packages)
if work_packages.respond_to?(:joins)
cast = @cf.field_format == 'int' ? 'INTEGER' : 'FLOAT'
cast = @cf.field_format == 'int' ? 'BIGINT' : 'FLOAT'
CustomValue
.where(customized: work_packages, custom_field: @cf)
@ -90,7 +90,7 @@ class Queries::WorkPackages::Columns::CustomFieldColumn < Queries::WorkPackages:
else
# TODO: eliminate calls of this method with an Array and drop the :compact call below
ActiveSupport::Deprecation.warn('Passing an array of work packages is deprecated. Pass an AR-relation instead.')
work_packages.map { |wp| value(wp) }.compact.reduce(:+)
work_packages.map { |wp| wp.typed_custom_value_for(@cf) }.compact.reduce(:+)
end
end

@ -99,7 +99,7 @@ module ::Query::Sums
end
def crunch(num)
return num if num.nil? or num.integer?
return num if num.nil? || !num.respond_to?(:integer?) || num.integer?
Float(format('%.2f', num.to_f))
end

Loading…
Cancel
Save