Use free_form_number

This commit is contained in:
2024-03-28 14:13:39 -04:00
parent e2f43d398f
commit 8c63817950

View File

@@ -158,8 +158,8 @@ class Customer < ActiveRecord::Base
#if not customer.name.eql? c.display_name #if not customer.name.eql? c.display_name
customer.name = c.display_name customer.name = c.display_name
customer.id = c.id customer.id = c.id
customer.phone_number = c.primary_phone.tr('^0-9', '') unless c.primary_phone.nil? customer.phone_number = c.primary_phone.free_form_number.tr('^0-9', '') unless c.primary_phone.nil?
customer.mobile_phone_number = c.mobile_phone.tr('^0-9', '') unless c.mobile_phone.nil? customer.mobile_phone_number = c.mobile_phone.free_form_number.tr('^0-9', '') unless c.mobile_phone.nil?
customer.save_without_push customer.save_without_push
#end #end
else else
@@ -192,8 +192,8 @@ class Customer < ActiveRecord::Base
#if not customer.name.eql? c.display_name #if not customer.name.eql? c.display_name
customer.name = c.display_name customer.name = c.display_name
customer.id = c.id customer.id = c.id
customer.phone_number = c.primary_phone.tr('^0-9', '') unless c.primary_phone.nil? customer.phone_number = c.primary_phone.free_form_number.tr('^0-9', '') unless c.primary_phone.nil?
customer.mobile_phone_number = c.mobile_phone.tr('^0-9', '') unless c.mobile_phone.nil? customer.mobile_phone_number = c.mobile_phone.free_form_number.tr('^0-9', '') unless c.mobile_phone.nil?
customer.save_without_push customer.save_without_push
#end #end
else else