mkhairi / materialize-sass

Materializecss rubygem for Rails Asset Pipeline / Sprockets
http://materialize.labs.my/
MIT License
806 stars 243 forks source link

Fix Rails 6 zeitwork autoloading deprecation #194

Closed maxtilford closed 4 years ago

maxtilford commented 4 years ago

Including the gem in a Rails 6 app results in the following error message:

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.

This change uses ActiveSupport's onload hook in order to ensure that the materialize helpers are added to the newly loaded ActionController::Base, whenever a reload occurs.

Fixes #192

rmehner commented 4 years ago

:wave: I've checked out your PR and it works fine for me. @mkhairi is there anything we can do to push this into a release? Need help? Happy to verify in older Rails versions if needed :)

rmehner commented 4 years ago

Thank you 🙏

Changed my Gemfile to:

gem "materialize-sass", github: "mkhairi/materialize-sass", ref: "6536812"

and the deprecation notices are gone! 🧙