diff options
Diffstat (limited to 'activesupport/lib/active_support/number_helper')
-rw-r--r-- | activesupport/lib/active_support/number_helper/number_to_phone_converter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb b/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb index 045f86c10f..4c33c30772 100644 --- a/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb +++ b/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb @@ -24,12 +24,12 @@ module ActiveSupport def convert_without_area_code(number) number.gsub!(/(\d{0,3})(\d{3})(\d{4})$/,"\\1#{delimiter}\\2#{delimiter}\\3") - number.slice!(0, 1) if begins_with_delimiter?(number) + number.slice!(0, 1) if start_with_delimiter?(number) number end - def begins_with_delimiter?(number) - number.start_with?(delimiter) && !delimiter.blank? + def start_with_delimiter?(number) + delimiter.present? && number.start_with?(delimiter) end def delimiter |