From 613c6f844c06e235d642f2b4de3ac740870688a0 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 28 Mar 2022 09:27:31 -0500 Subject: [PATCH] LazyObject is not nil, so safenav doesn't work --- forms/configure_calls.rb | 4 ++-- lib/customer_info.rb | 2 +- lib/customer_repo.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/forms/configure_calls.rb b/forms/configure_calls.rb index 6f6a3d34fd65f15735c2bdbea761b5e2b4ccd3ce..a9312e2a4ff0d486585c7eb678e92076318ec882 100644 --- a/forms/configure_calls.rb +++ b/forms/configure_calls.rb @@ -31,14 +31,14 @@ field( value: @customer.fwd.uri ) -if (lidb = @customer.tndetails&.dig(:features, :lidb)) +if (lidb = @customer.tndetails.dig(:features, :lidb)) field( var: "lidb_name", type: "fixed", label: "CNAM", value: "#{lidb[:subscriber_information]} (#{lidb[:status]})" ) -elsif @customer.tndetails&.dig(:on_net_vendor) +elsif @customer.tndetails[:on_net_vendor] field( var: "lidb_name", type: "text-single", diff --git a/lib/customer_info.rb b/lib/customer_info.rb index 29f0fbd9707f0df6621ee05e99a54f3807f18433..ebe13a8c90f6ad6a100e614f70354d21cfda3193 100644 --- a/lib/customer_info.rb +++ b/lib/customer_info.rb @@ -83,7 +83,7 @@ class CustomerInfo plan_info: plan_info, tel: customer.registered? ? customer.registered?.phone : nil, balance: customer.balance, - cnam: customer.tndetails&.dig(:features, :lidb, :subscriber_information) + cnam: customer.tndetails.dig(:features, :lidb, :subscriber_information) ) end end diff --git a/lib/customer_repo.rb b/lib/customer_repo.rb index e943810ca7e4ac640c2e1707f981788fbded6af3..7311f0045ec4025be507e2d3b5f0c5acc165d993 100644 --- a/lib/customer_repo.rb +++ b/lib/customer_repo.rb @@ -167,7 +167,7 @@ protected def tndetails(sgx) return unless sgx.registered? - LazyObject.new { @bandwidth_tn_repo.find(sgx.registered?.phone) } + LazyObject.new { @bandwidth_tn_repo.find(sgx.registered?.phone) || {} } end def find_inner(customer_id, jid)