mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-20 18:42:03 +00:00
NoMethodError: undefined method `id' error on EnumerationFormat#value_from_keyword (#22911).
Patch by Haihan Ji. git-svn-id: http://svn.redmine.org/redmine/trunk@15429 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
95bf7fbc37
commit
fad71f8b4b
@ -715,7 +715,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def value_from_keyword(custom_field, keyword, object)
|
def value_from_keyword(custom_field, keyword, object)
|
||||||
value = custom_field.enumerations.where("LOWER(name) LIKE LOWER(?)", keyword)
|
value = custom_field.enumerations.where("LOWER(name) LIKE LOWER(?)", keyword).first
|
||||||
value ? value.id : nil
|
value ? value.id : nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -84,4 +84,8 @@ class Redmine::EnumerationFieldFormatTest < ActionView::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_value_from_keyword_should_return_enumeration_id
|
||||||
|
assert_equal @foo.id, @field.value_from_keyword('foo', nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user