Skip to content

Commit

Permalink
Merge pull request #2 from CirrusMD/cb/fix-autoload-deprecations
Browse files Browse the repository at this point in the history
Fix Rails 6 autoloading on initialize warnings
  • Loading branch information
corytheboyd-cirrusmd authored Jun 17, 2021
2 parents 28ad383 + 369c9e7 commit 5b8aeb4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/adminsimple/rails/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ class Engine < ::Rails::Engine
engine_name 'adminsimple'

initializer "adminsimple.view_helpers" do

ActiveSupport.on_load :action_view do
ActionView::Base.send :include, Adminsimple::ViewHelpers
ActionView::Base.send :include, Adminsimple::Modules::WidgetBoxHelpers
ActionView::Base.send :include, Adminsimple::Modules::PageHeaderHelpers
Rails.application.reloader.to_prepare do
ActionView::Base.send :include, Adminsimple::ViewHelpers
ActionView::Base.send :include, Adminsimple::Modules::WidgetBoxHelpers
ActionView::Base.send :include, Adminsimple::Modules::PageHeaderHelpers
end
end
end

Expand Down

0 comments on commit 5b8aeb4

Please sign in to comment.