FilestackRails::ApplicationHelper, and FilestackRails::FormHelper autoloaded by Rails
Closed this issue · 3 comments
PhilCoggins commented
On Rails 6, warnings are thrown during app initialization:
WARN -- : DEPRECATION WARNING: Initialization autoloaded the constants FilestackRails::ApplicationHelper, and FilestackRails::FormHelper.
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 FilestackRails::ApplicationHelper, for example,
the expected changes won't be reflected in that stale Class object.
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
FilestackRails::ApplicationHelper
, and FilestackRails::FormHelper
are autoloaded by Rails during initialization as there is nothing in the gem require
ing those files. I can get around by opening the gem code locally and adding the following to lib/filestack-rails.rb
:
require_relative "../app/helpers/filestack_rails/application_helper"
require_relative "../app/helpers/filestack_rails/form_helper"
Would it be possible for you to add something similar so these files can be required before hitting Rails autoloader?
gabifija commented
@PhilCoggins Thanks for your comment. I'll take a look on the case. I'll figure that out soon.
gabifija commented
@PhilCoggins Sorry for the delay. Now it is fixed in 5.3.0.
PhilCoggins commented
@gabifiolek Thank you so much!