Nil Checks

This commit is contained in:
2024-03-28 14:01:18 -04:00
parent 7ba4829066
commit e2f43d398f

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', '') customer.phone_number = c.primary_phone.tr('^0-9', '') unless c.primary_phone.nil?
customer.mobile_phone_number = c.mobile_phone.tr('^0-9', '') customer.mobile_phone_number = c.mobile_phone.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', '') customer.phone_number = c.primary_phone.tr('^0-9', '') unless c.primary_phone.nil?
customer.mobile_phone_number = c.mobile_phone.tr('^0-9', '') customer.mobile_phone_number = c.mobile_phone.tr('^0-9', '') unless c.mobile_phone.nil?
customer.save_without_push customer.save_without_push
#end #end
else else