From 92bd0c6fcc1788fbd7235c697003cbe30670bbfc Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 17 May 2022 08:24:46 -0500 Subject: [PATCH] EmptyRepo can wrap another to allow mutation --- lib/empty_repo.rb | 4 +++- sgx_jmp.rb | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/empty_repo.rb b/lib/empty_repo.rb index e559bbf680a86c91a303f8866a91a7f5ba2f18a1..9e6ba426f319de7e8a0963b21f92342e138ba97d 100644 --- a/lib/empty_repo.rb +++ b/lib/empty_repo.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true -class EmptyRepo +require "delegate" + +class EmptyRepo < SimpleDelegator def find(*); end end diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 763e025f11ada9a550d34290a4a67a5dc9116471..80a9c92cabbd66e21e060e7325cc1a23ff44bdbd 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -72,6 +72,7 @@ require_relative "lib/backend_sgx" require_relative "lib/bwmsgsv2_repo" require_relative "lib/bandwidth_iris_patch" require_relative "lib/bandwidth_tn_order" +require_relative "lib/bandwidth_tn_repo" require_relative "lib/btc_sell_prices" require_relative "lib/buy_account_credit_form" require_relative "lib/configure_calls_form" @@ -757,7 +758,7 @@ Command.new( customer_repo = CustomerRepo.new( sgx_repo: Bwmsgsv2Repo.new, - bandwidth_tn_repo: EmptyRepo.new # No CNAM in admin + bandwidth_tn_repo: EmptyRepo.new(BandwidthTnRepo.new) # No CNAM in admin ) Command.reply { |reply|