Skip to content

Commit 938f58b

Browse files
authored
Use lazy load hooks to safely integrate with ActionController (#14)
This uses the ActiveSupport Lazy Load hooks callback to integrate ZipKit once ActionController is loaded. Previously, the Railtie would force ActionController to load which can cause problems.
1 parent c920f6b commit 938f58b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/zip_kit/railtie.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
class ZipKit::Railtie < ::Rails::Railtie
44
initializer "zip_kit.install_extensions" do |app|
5-
ActionController::Base.include(ZipKit::RailsStreaming)
5+
ActiveSupport.on_load(:action_controller) do
6+
include(ZipKit::RailsStreaming)
7+
end
68
end
79
end

0 commit comments

Comments
 (0)