Skip to content

Commit

Permalink
Autoload issue with ImpressionistController
Browse files Browse the repository at this point in the history
Instead of depending on autoload to bring in the
`ImpressionistController` constant, we manually bring it with a call
to `require` and just move that file to `lib`.

Prior to this, Rails would emit a warning on startup about needing to
use autoload durning an initializer like this, letting us know that a
future version of Rails will error from this.

This should hopefully remove that error and still allow these
controller mixins to be available.

Co-authored-by: stefannibrasil <[email protected]>
  • Loading branch information
keegnotrub and stefannibrasil committed Oct 10, 2023
1 parent b02be39 commit f87e570
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 0 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions lib/impressionist/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Engine < ::Rails::Engine


initializer 'impressionist.controller' do
require "impressionist/controllers/impressionist_controller"
require "impressionist/controllers/mongoid/impressionist_controller" if orm == :mongoid.to_s

ActiveSupport.on_load(:action_controller) do
Expand Down

0 comments on commit f87e570

Please sign in to comment.