Use lazy load hooks to hook on ActionController::Base

- Calling directly `ActionController::Base` affects the initialization process (one of them being one that controls ActionController [configuration](aa6bcbbac8/actionpack/lib/action_controller/railtie.rb (L53-L67)))
- As a result setting configuration inside an initializer (such as the asset_host), won't have any effect
This commit is contained in:
Edouard CHIN 2017-11-02 17:11:39 -04:00
parent febc601aff
commit 11cde28f7a
1 changed files with 3 additions and 1 deletions

View File

@ -26,4 +26,6 @@ require 'ransack/translate'
Ransack::Adapters.object_mapper.require_adapter
ActionController::Base.helper Ransack::Helpers::FormHelper
ActiveSupport.on_load(:action_controller) do
ActionController::Base.helper Ransack::Helpers::FormHelper
end