From f68da9cdf328b5817712497cae3db707622538e7 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 25 Aug 2021 19:21:59 -0500 Subject: [PATCH] The sugar version prevents the promise from being returned --- .rubocop.yml | 3 +++ lib/backend_sgx.rb | 2 +- lib/customer.rb | 2 +- lib/registration.rb | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index eb580f9..d9efb21 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -81,3 +81,6 @@ Style/FormatString: Style/FormatStringToken: EnforcedStyle: unannotated + +Naming/AccessorMethodName: + Enabled: false diff --git a/lib/backend_sgx.rb b/lib/backend_sgx.rb index 30b4513..8001e96 100644 --- a/lib/backend_sgx.rb +++ b/lib/backend_sgx.rb @@ -33,7 +33,7 @@ class BackendSgx end end - def fwd_timeout=(timeout) + def set_fwd_timeout(timeout) REDIS.set("catapult_fwd_timeout-#{from_jid}", timeout) end diff --git a/lib/customer.rb b/lib/customer.rb index d5e7d1c..1600130 100644 --- a/lib/customer.rb +++ b/lib/customer.rb @@ -20,7 +20,7 @@ class Customer attr_reader :customer_id, :balance, :jid def_delegators :@plan, :active?, :activate_plan_starting_now, :bill_plan, :currency, :merchant_account, :plan_name, :auto_top_up_amount - def_delegators :@sgx, :register!, :registered?, :fwd_timeout= + def_delegators :@sgx, :register!, :registered?, :set_fwd_timeout def_delegators :@usage, :usage_report, :message_usage, :incr_message_usage def initialize( diff --git a/lib/registration.rb b/lib/registration.rb index a34bdec..a5984db 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -455,7 +455,7 @@ class Registration EMPromise.all([ REDIS.del("pending_tel_for-#{@customer.jid}"), REDIS.set("catapult_fwd-#{@tel}", cheogram_sip_addr), - @customer.fwd_timeout = 25 # ~5 seconds / ring, 5 rings + @customer.set_fwd_timeout(25) # ~5 seconds / ring, 5 rings ]) }.then do Command.finish("Your JMP account has been activated as #{@tel}") -- 2.38.5