From dc5c316caf269c35845d29bc949b12acd3be69d8 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 16 Apr 2019 16:20:34 +0200 Subject: [PATCH] Allow new call to RemoteCensusApi on CensusCaller When Setting["feature.remote_census"] is active, we allow and ability the calls to new RemoteCensusAPI througth CensusCaller --- lib/census_caller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/census_caller.rb b/lib/census_caller.rb index d104b03c8..c0a7f1c89 100644 --- a/lib/census_caller.rb +++ b/lib/census_caller.rb @@ -1,7 +1,11 @@ class CensusCaller def call(document_type, document_number) - response = CensusApi.new.call(document_type, document_number) + if Setting["feature.remote_census"].present? + response = RemoteCensusApi.new.call(document_type, document_number) + else + response = CensusApi.new.call(document_type, document_number) + end response = LocalCensus.new.call(document_type, document_number) unless response.valid? response