Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoloading Deprecation Warning #40

Open
sunny opened this issue Mar 28, 2020 · 1 comment · May be fixed by #41
Open

Autoloading Deprecation Warning #40

sunny opened this issue Mar 28, 2020 · 1 comment · May be fixed by #41
Assignees
Labels

Comments

@sunny
Copy link
Contributor

sunny commented Mar 28, 2020

Describe the bug

Under Rails 6, the gem adds the following deprecation warning:

DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper and ActionText::TagHelper.

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 ActionText::ContentHelper, for example,
the expected changes won't be reflected in that stale Module object.

`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.

Please, check the "Autoloading and Reloading Constants" guide for solutions.
 (called from <top (required)> at /Users/sunny/code/cults/config/environment.rb:7)

To Reproduce

  1. Create a Rails 6.0.2.2 app:

    rails new honeypot-captcha-rails-example
    cd honeypot-captcha-rails-example
    rails test

    At this point there is no deprecation warning.

  2. Add the gem:

    echo "gem 'honeypot-captcha'" >> Gemfile
    bundle
    spring stop
    rails test

    The "DEPRECATION WARNING" message appears.

@sunny sunny added the bug label Mar 28, 2020
@sunny sunny linked a pull request Mar 28, 2020 that will close this issue
7 tasks
@moveson
Copy link

moveson commented Mar 21, 2021

@curtis Is there a plan to review the linked PR? Looks like a solid fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants