summaryrefslogtreecommitdiffstats
path: root/lib/redmine/field_format.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-28 11:37:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-28 11:37:28 +0000
commitfad71f8b4bd8f1079c3fe355dc2dafeb2b5ca9ee (patch)
treee0fece80a486376643df4615940f7097c640e5d5 /lib/redmine/field_format.rb
parent95bf7fbc375014e942b11a341aeac757663328e8 (diff)
downloadredmine-fad71f8b4bd8f1079c3fe355dc2dafeb2b5ca9ee.tar.gz
redmine-fad71f8b4bd8f1079c3fe355dc2dafeb2b5ca9ee.zip
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
Diffstat (limited to 'lib/redmine/field_format.rb')
-rw-r--r--lib/redmine/field_format.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb
index c7e8115a6..dd94eeefd 100644
--- a/lib/redmine/field_format.rb
+++ b/lib/redmine/field_format.rb
@@ -715,7 +715,7 @@ module Redmine
end
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
end
end