##// END OF EJS Templates
NoMethodError: undefined method `id' error on EnumerationFormat#value_from_keyword (#22911)....
Jean-Philippe Lang -
r15047:fad71f8b4bd8
parent child
Show More
@@ -715,7 +715,7 module Redmine
715 715 end
716 716
717 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 719 value ? value.id : nil
720 720 end
721 721 end
@@ -84,4 +84,8 class Redmine::EnumerationFieldFormatTest < ActionView::TestCase
84 84 end
85 85 end
86 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 91 end
General Comments 0
You need to be logged in to leave comments. Login now