Skip to content

Commit

Permalink
parse number only if options[:raise] is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Oct 17, 2010
1 parent ea7db8e commit 0d5d70f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions actionpack/lib/action_view/helpers/number_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d5d70f

Please sign in to comment.