1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make both conversion methods work similarly

The conversion without area code already changed the passed number in
place, so change the other method to do the same.
This commit is contained in:
Carlos Antonio da Silva 2013-12-03 19:55:40 -02:00
parent 308ed01f14
commit a63d8cd9e1

View file

@ -18,7 +18,8 @@ module ActiveSupport
end
def convert_with_area_code(number)
number.gsub(/(\d{1,3})(\d{3})(\d{4}$)/,"(\\1) \\2#{delimiter}\\3")
number.gsub!(/(\d{1,3})(\d{3})(\d{4}$)/,"(\\1) \\2#{delimiter}\\3")
number
end
def convert_without_area_code(number)