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