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