lib/avromatic.rb in avromatic-0.9.0 vs lib/avromatic.rb in avromatic-0.10.0.rc0
- old
+ new
@@ -5,11 +5,11 @@
require 'avro_turf/messaging'
module Avromatic
class << self
attr_accessor :schema_registry, :registry_url, :schema_store, :logger,
- :messaging, :type_registry, :nested_models
+ :messaging, :type_registry, :nested_models, :on_initialize
delegate :register_type, to: :type_registry
end
self.nested_models = ModelRegistry.new
@@ -36,9 +36,14 @@
)
end
def self.build_messaging!
self.messaging = build_messaging
+ end
+
+ def self.prepare!
+ nested_models.clear
+ on_initialize.call if on_initialize
end
end
require 'avromatic/railtie' if defined?(Rails)