lib/karafka/railtie.rb in karafka-2.0.18 vs lib/karafka/railtie.rb in karafka-2.0.19

- old
+ new

@@ -3,10 +3,11 @@ # This file contains Railtie for auto-configuration rails = false begin - require 'rails' + # Do not load Rails again if already loaded + Object.const_defined?('Rails::Railtie') || require('rails') rails = true rescue LoadError # Without defining this in any way, Zeitwerk ain't happy so we do it that way module Karafka