]> source.dussan.org Git - redmine.git/commitdiff
Use #get instead of #[] to read errors on the attribute.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 19 Nov 2016 11:10:07 +0000 (11:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 19 Nov 2016 11:10:07 +0000 (11:10 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15988 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/views/labelled_form_builder.rb

index 07805c562da3b9ca9905eadd2d0b6ebc6c7bda90..9ef41d0b4de063f5ec537b2585f9d4f4eb5086e7 100644 (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