When a model attribute methods have been manually overwritten by the programmer, FormHelper's text_field method ignores it and uses 'method_before_type_cast' instead. This is inconsistent with the docs at http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html that state that
<%= text_field "person", "name", "size" => 20 %>
is equivalent to
<input type="text" id="person_name" name="person[name]"
size="20" value="<%= @person.name %>" />
But it is rather equivalent to
<input type="text" id="person_name" name="person[name]"
size="20" value="<%= @person.name_before_type_cast %>" />
My patch fixes that and all actionpack tests still pass after the change. But this patch may still be unsafe. I assume someone chose to use value_before_type_cast with some reason.