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

BadgeLabelHelper autoload Deprecation Warning #936

Open
Robstaa opened this issue Jan 7, 2020 · 2 comments
Open

BadgeLabelHelper autoload Deprecation Warning #936

Robstaa opened this issue Jan 7, 2020 · 2 comments

Comments

@Robstaa
Copy link

Robstaa commented Jan 7, 2020

Using
rails (~> 6.0.2, >= 6.0.2.1)
twitter-bootstrap-rails (3.2.2)

I get following Warning when running my tests via rspec:

DEPRECATION WARNING: Initialization autoloaded the constant BadgeLabelHelper.

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

This autoloaded constant has been unloaded.

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

Is there a plan to fix this in upcoming versions, or an easy manual fix? Thanks!
@paxer
Copy link

paxer commented May 28, 2021

until twitter-bootstrap-rails gem will fix it - the solution could be to add config/initializers/twitter_bootstrap_rails.rb with

gem_dir = Gem::Specification.find_by_name("twitter-bootstrap-rails").gem_dir
require "#{gem_dir}/app/helpers/badge_label_helper"

@fxn
Copy link

fxn commented Nov 12, 2021

This was addressed by #935. I believe this issue can be closed.

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

No branches or pull requests

4 participants