Extend ActiveAdmin the before_load way instead of within the engines
Using the engine causes Rails deprecation warnings because of Autoloading
The PR attacks the same problem as #21 but the problem was not resolved.
The workaround here is to use ActiveAdmin.before_load system instead of the initializer, because ActiveAdmin::ResourceController autoloads a lot of stuff, wich is now deprecated during initialize phase.
Here are the traces that I had before this patch:
DEPRECATION WARNING: Initialization autoloaded the constants CampagneHelper, ApplicationHelper, StructureHelper, AnonymeHelper, ActiveAdmin::ViewsHelper, DeviseHelper, ApplicationController, and InheritedResources::Base.
Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.
Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload CampagneHelper, for example,
the expected changes won't be reflected in that stale Module object.
These autoloaded constants have been unloaded.
In order to autoload safely at boot time, please wrap your code in a reloader
callback this way:
Rails.application.reloader.to_prepare do
# Autoload classes and modules needed at boot time here.
end
@thambley did you had the chance to take a look at this PR ? 🙏
👋 @thambley , same question as above :)
@thambley ? :)
@thambley any news for this PR ? :) 🙏
With @shanser, we have made a fork on Captive-Studio : https://github.com/Captive-Studio/activeadmin-xls
If someone have the same issue, you can use our fork ;)