twitter-bootstrap-rails
twitter-bootstrap-rails copied to clipboard
Revise loading helpers during initialization
The way this engine loads helpers has a couple of things that can be polished.
On one hand, when referring to a framework component, it is better to wrap your code in an ActiveSupport.on_load
hook, because that is the public contract to say: This component is ready.
Then, the to_prepare
callbacks are not necessary. You wrap your code in to_prepare
blocks in order to use reloaded stuff again. However, in this case nothing is reloaded, because framework classes and modules like ActionController::Base
aren't.
Since I was on it, the patch suggests to remove the require_relative
calls. Just autoload, but put the helpers in the autoload_once_paths
to tell Rails this code is not reloadable. You can autoload during boot from these paths even in Rails 7.
If client code had leftover require
calls in place to workaround #936, that is still compatible.