Skip to content

Commit

Permalink
Merged r13141 (#16926).
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13163 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
jplang committed May 24, 2014
1 parent 221c839 commit 54a12cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/redmine/field_format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ def cast_value(custom_field, value, customized=nil)
if value.blank?
nil
elsif value.is_a?(Array)
value.map do |v|
casted = value.map do |v|
cast_single_value(custom_field, v, customized)
end.sort
end
casted.compact.sort
else
cast_single_value(custom_field, value, customized)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@ def test_possible_values_options_should_return_project_versions_with_selected_st

assert_equal expected, field.possible_values_options(project).map(&:first)
end

def test_cast_value_should_not_raise_error_when_array_contains_value_casted_to_nil
field = IssueCustomField.new(:field_format => 'version')
assert_nothing_raised do
field.cast_value([1,2, 42])
end
end
end

0 comments on commit 54a12cc

Please sign in to comment.