FormHelper should only use *_before_type_cast if they available on the model

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@229 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2004-12-19 16:39:56 +00:00
parent 69cb942d9b
commit dad37cfafa
2 changed files with 6 additions and 1 deletions

View File

@@ -192,7 +192,11 @@ module ActionView
end
def value_before_type_cast
object.send(@method_name + "_before_type_cast") unless object.nil?
unless object.nil?
object.respond_to?(@method_name + "_before_type_cast") ?
object.send(@method_name + "_before_type_cast") :
object.send(@method_name)
end
end
private