Skip to content

Commit

Permalink
Fix rails 6 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chaadow committed Aug 15, 2024
1 parent f132217 commit 7982a1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/best_in_place/engine.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
module BestInPlace
class Engine < Rails::Engine
initializer 'best_in_place' do
ActionView::Base.send(:include, BestInPlace::Helper)
ActionController::Base.send(:include, BestInPlace::ControllerExtensions)
ActiveSupport.on_load(:action_controller) do
ActionView::Base.send(:include, BestInPlace::Helper)

ActionController::Base.send(:include, BestInPlace::ControllerExtensions)
end
end
end
end
2 changes: 1 addition & 1 deletion lib/best_in_place/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module BestInPlace
class Railtie < ::Rails::Railtie #:nodoc:
config.after_initialize do
BestInPlace::ViewHelpers = ActionView::Base.new({}, {}, "")
BestInPlace::ViewHelpers = ActionView::Base.respond_to?(:empty) ? ActionView::Base.empty : ActionView::Base.new
end
end
end

0 comments on commit 7982a1e

Please sign in to comment.