##// END OF EJS Templates
Merged r15429 (#22911)....
Jean-Philippe Lang -
r15057:3b3478b8a3a3
parent child
Show More
@@ -715,7 +715,7 module Redmine
715 end
715 end
716
716
717 def value_from_keyword(custom_field, keyword, object)
717 def value_from_keyword(custom_field, keyword, object)
718 value = custom_field.enumerations.where("LOWER(name) LIKE LOWER(?)", keyword)
718 value = custom_field.enumerations.where("LOWER(name) LIKE LOWER(?)", keyword).first
719 value ? value.id : nil
719 value ? value.id : nil
720 end
720 end
721 end
721 end
@@ -84,4 +84,8 class Redmine::EnumerationFieldFormatTest < ActionView::TestCase
84 end
84 end
85 end
85 end
86 end
86 end
87
88 def test_value_from_keyword_should_return_enumeration_id
89 assert_equal @foo.id, @field.value_from_keyword('foo', nil)
90 end
87 end
91 end
General Comments 0
You need to be logged in to leave comments. Login now