Generated nested models register themselves upon being created by
Avromatic::Model::Builder. If Rails's autoloader didn't recreate a model that
should be eager loaded, then its nested models won't be registered as we hook on
Railtie #to_prepare that itself triggers a clean-up of the nested models
registry.
Therefore, we have to go through the attribute definitions of each eager loaded
model and try to register its nested models.
Generated nested models register themselves upon being created by
Avromatic::Model::Builder
. If Rails's autoloader didn't recreate a model that should be eager loaded, then its nested models won't be registered as we hook on Railtie#to_prepare
that itself triggers a clean-up of the nested models registry.Therefore, we have to go through the attribute definitions of each eager loaded model and try to register its nested models.
prime @jturkel