From: Jean-Philippe Lang Date: Sat, 19 Nov 2016 11:10:07 +0000 (+0000) Subject: Use #get instead of #[] to read errors on the attribute. X-Git-Tag: 3.4.0~569 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e610fda877a44c7b194edddcbe6c71bb234401a1;p=redmine.git 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 --- diff --git a/lib/redmine/views/labelled_form_builder.rb b/lib/redmine/views/labelled_form_builder.rb index 07805c562..9ef41d0b4 100644 --- a/lib/redmine/views/labelled_form_builder.rb +++ b/lib/redmine/views/labelled_form_builder.rb @@ -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