mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user