Permalink
Browse files

parse number only if options[:raise] is provided

  • Loading branch information...
1 parent ea7db8e commit 0d5d70f1a323efe05f835fce97f7d82fdf198732 @spastorino spastorino committed Oct 17, 2010
Showing with 2 additions and 4 deletions.
  1. +2 −4 actionpack/lib/action_view/helpers/number_helper.rb
@@ -52,10 +52,8 @@ def number_to_phone(number, options = {})
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

0 comments on commit 0d5d70f

Please sign in to comment.