diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-10-17 20:44:06 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-10-17 20:44:06 -0200 |
commit | 0d5d70f1a323efe05f835fce97f7d82fdf198732 (patch) | |
tree | d0b8cae4f793807bde5b520ddd7ad4954fa501c3 /actionpack/lib | |
parent | ea7db8ebc11bedc2d98dac03df96bd73f6bfcf6b (diff) | |
download | rails-0d5d70f1a323efe05f835fce97f7d82fdf198732.tar.gz rails-0d5d70f1a323efe05f835fce97f7d82fdf198732.tar.bz2 rails-0d5d70f1a323efe05f835fce97f7d82fdf198732.zip |
parse number only if options[:raise] is provided
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/number_helper.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb index 15f032b3d6..4f8cc2012c 100644 --- a/actionpack/lib/action_view/helpers/number_helper.rb +++ b/actionpack/lib/action_view/helpers/number_helper.rb @@ -52,10 +52,8 @@ module ActionView begin Float(number) rescue ArgumentError, TypeError - if options[:raise] - raise InvalidNumberError, number - end - end + raise InvalidNumberError, number + end if options[:raise] number = number.to_s.strip options = options.symbolize_keys |