1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-28 03:11:15 +00:00

Use #get instead of #[] to read errors on the attribute.

git-svn-id: http://svn.redmine.org/redmine/trunk@15988 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2016-11-19 11:10:07 +00:00
parent d19aea9437
commit e610fda877

View File

@ -45,7 +45,7 @@ class Redmine::Views::LabelledFormBuilder < ActionView::Helpers::FormBuilder
# A field for entering hours value
def hours_field(field, options={})
# display the value before type cast when the entered value is not valid
if @object.errors[field].blank?
if @object.errors.get(field).blank?
options = options.merge(:value => format_hours(@object.send field))
end
text_field field, options