seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 996 forks source link

BadgeLabelHelper autoload Deprecation Warning #936

Open Robstaa opened 4 years ago

Robstaa commented 4 years ago

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 commented 3 years ago

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 commented 2 years ago

This was addressed by https://github.com/seyhunak/twitter-bootstrap-rails/pull/935. I believe this issue can be closed.