aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-19 16:39:56 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-19 16:39:56 +0000
commitdad37cfafa65a9f0ed2d0db6473c1d6b323dcdfe (patch)
treedc3804304bf039955989bd86d98990b40b6b9be9 /actionpack
parent69cb942d9b72d9a18f8d00c5887f2532bdda0a0f (diff)
downloadrails-dad37cfafa65a9f0ed2d0db6473c1d6b323dcdfe.tar.gz
rails-dad37cfafa65a9f0ed2d0db6473c1d6b323dcdfe.tar.bz2
rails-dad37cfafa65a9f0ed2d0db6473c1d6b323dcdfe.zip
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
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index d9a1c7d55e..105f464fc8 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -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