diff --git a/activesupport/lib/active_support/fork_tracker.rb b/activesupport/lib/active_support/fork_tracker.rb index f9e112d234b..cb004f432e4 100644 --- a/activesupport/lib/active_support/fork_tracker.rb +++ b/activesupport/lib/active_support/fork_tracker.rb @@ -18,6 +18,11 @@ module ActiveSupport end end + module CoreExtPrivate + include CoreExt + private :fork + end + @pid = Process.pid @callbacks = [] @@ -30,7 +35,7 @@ module ActiveSupport end def hook! - ::Object.prepend(CoreExt) + ::Object.prepend(CoreExtPrivate) ::Kernel.singleton_class.prepend(CoreExt) ::Process.singleton_class.prepend(CoreExt) end diff --git a/activesupport/test/fork_tracker_test.rb b/activesupport/test/fork_tracker_test.rb index 07fad110248..990cafba681 100644 --- a/activesupport/test/fork_tracker_test.rb +++ b/activesupport/test/fork_tracker_test.rb @@ -12,6 +12,7 @@ class ForkTrackerTest < ActiveSupport::TestCase write.write "forked" end + assert_not respond_to?(:fork) pid = fork do read.close write.close