diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-01-25 12:08:22 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-01-25 12:08:22 +0000 |
commit | 5faa1a4e6ed934e026a58a87de1e3f407ea99c97 (patch) | |
tree | 4fa583cebaf3436578c8609b78c473ed336437a5 /lib/plugins/acts_as_customizable | |
parent | 20ff37ef42dbc95258209655e611de34538e505f (diff) | |
download | redmine-5faa1a4e6ed934e026a58a87de1e3f407ea99c97.tar.gz redmine-5faa1a4e6ed934e026a58a87de1e3f407ea99c97.zip |
REST API: Integer custom field validation fails when using non-string values (#15929).
git-svn-id: http://svn.redmine.org/redmine/trunk@12704 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins/acts_as_customizable')
-rw-r--r-- | lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb b/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb index 3575cc550..b4863f731 100644 --- a/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb +++ b/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb @@ -72,10 +72,12 @@ module Redmine if values.has_key?(key) value = values[key] if value.is_a?(Array) - value = value.reject(&:blank?).uniq + value = value.reject(&:blank?).map(&:to_s).uniq if value.empty? value << '' end + else + value = value.to_s end custom_field_value.value = value end |