From 6662968b345e95636167e87b47d37b9cc8ce20ff Mon Sep 17 00:00:00 2001 From: Ariana Jung Date: Fri, 14 Jul 2023 11:29:51 -0400 Subject: [PATCH] fix bug --- lib/deimos/config/configuration.rb | 2 +- lib/deimos/utils/schema_class.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/deimos/config/configuration.rb b/lib/deimos/config/configuration.rb index 7677d43c..f012962d 100644 --- a/lib/deimos/config/configuration.rb +++ b/lib/deimos/config/configuration.rb @@ -86,7 +86,7 @@ def self.configure_producer_or_consumer(kafka_config) schema(kafka_config.schema) if kafka_config.schema.present? namespace(kafka_config.namespace) if kafka_config.namespace.present? key_config(**kafka_config.key_config) if kafka_config.key_config.present? - schema_class_config(kafka_config.use_schema_classes) if kafka_config.use_schema_classes.present? + schema_class_config(kafka_config.use_schema_classes) if kafka_config.respond_to?(:bulk_import_id_column) # consumer klass.config.merge!( bulk_import_id_column: kafka_config.bulk_import_id_column, diff --git a/lib/deimos/utils/schema_class.rb b/lib/deimos/utils/schema_class.rb index 26c08909..8dd5253e 100644 --- a/lib/deimos/utils/schema_class.rb +++ b/lib/deimos/utils/schema_class.rb @@ -35,8 +35,7 @@ def instance(payload, schema, namespace='') # @param config [Hash] Producer or Consumer config # @return [Boolean] def use?(config) - use_schema_classes = config[:use_schema_classes] - use_schema_classes.present? ? use_schema_classes : Deimos.config.schema.use_schema_classes + config.has_key?(:use_schema_classes) ? config[:use_schema_classes] : Deimos.config.schema.use_schema_classes end end