lib/avromatic.rb in avromatic-4.1.0 vs lib/avromatic.rb in avromatic-4.1.1
- old
+ new
@@ -27,11 +27,10 @@
self.use_schema_fingerprint_lookup = true
self.allow_unknown_attributes = false
def self.configure
yield self
- eager_load_models!
end
def self.build_schema_registry
raise 'Avromatic must be configured with a registry_url' unless registry_url
@@ -64,21 +63,19 @@
self.messaging = build_messaging
end
# This method is called as a Rails to_prepare hook after the application
# first initializes during boot-up and prior to each code reloading.
- # For the first call during boot-up we do not want to clear the nested_models.
- def self.prepare!(skip_clear: false)
- unless skip_clear
- nested_models.clear
- if schema_store
- if schema_store.respond_to?(:clear_schemas)
- schema_store.clear_schemas
- elsif schema_store.respond_to?(:clear)
- schema_store.clear
- end
+ def self.prepare!
+ nested_models.clear
+ if schema_store
+ if schema_store.respond_to?(:clear_schemas)
+ schema_store.clear_schemas
+ elsif schema_store.respond_to?(:clear)
+ schema_store.clear
end
end
+
eager_load_models!
end
def self.eager_load_models=(models)
@eager_load_model_names = Array(models).map { |model| model.is_a?(Class) ? model.name : model }