[25377] Don't use to_s on array in filter helper

https://community.openproject.com/projects/openproject/work_packages/25377
pull/5585/head
Oliver Günther 8 years ago
parent c676d97881
commit 5ec65a0ca1
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 10
      app/helpers/work_packages_filter_helper.rb

@ -230,7 +230,7 @@ module WorkPackagesFilterHelper
def filter_object(property, operator, values = nil) def filter_object(property, operator, values = nil)
v3_property = API::Utilities::PropertyNameConverter.from_ar_name(property) v3_property = API::Utilities::PropertyNameConverter.from_ar_name(property)
values = values.to_s if values values = filter_values(values) if values
{ {
n: v3_property, n: v3_property,
@ -238,4 +238,12 @@ module WorkPackagesFilterHelper
v: values v: values
}.compact }.compact
end end
def filter_values(values)
if values.is_a? Array
values.map(&:to_s)
else
values.to_s
end
end
end end

Loading…
Cancel
Save