Skip to content

Commit 638c232

Browse files
committed
Fix Rails 7.1 compatibility by ensuring active_support is required before railtie
Not sure if this is us, strictly speaking but we seem to need to require active_support before the railties or the issue at rails/rails#49495 (comment) occurs Since we do reference loggers here, seems appropriate for us to require ourselves.
1 parent f52da2e commit 638c232

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/main/ruby/jruby/rack/rails/railtie.rb

+2-11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# See the file LICENSE.txt for details.
77
#++
88

9+
require 'active_support'
910
require 'rails/railtie'
1011
require 'pathname'
1112

@@ -42,17 +43,7 @@ class Railtie < ::Rails::Railtie
4243
logger.level = logger.class.const_get(log_level.to_s.upcase)
4344
log_formatter = config.log_formatter if config.respond_to?(:log_formatter) # >= 4.0
4445
logger.formatter = log_formatter if log_formatter && logger.respond_to?(:formatter=)
45-
if defined?(ActiveSupport::TaggedLogging)
46-
if ActiveSupport::TaggedLogging.is_a?(Class) # Rails 3.2
47-
logger = ActiveSupport::TaggedLogging.new(logger)
48-
else # Rails 4.0
49-
# extends the logger as well as it's logger.formatter instance :
50-
# NOTE: good idea to keep or should we use a clone as Rails.logger ?
51-
#dup_logger = logger.dup
52-
#dup_logger.formatter = logger.formatter.dup
53-
logger = ActiveSupport::TaggedLogging.new(logger)
54-
end
55-
end
46+
logger = ActiveSupport::TaggedLogging.new(logger)
5647
logger
5748
end
5849
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#--
2+
# Copyright (c) 2010-2012 Engine Yard, Inc.
3+
# Copyright (c) 2007-2009 Sun Microsystems, Inc.
4+
# This source code is available under the MIT license.
5+
# See the file LICENSE.txt for details.
6+
#++
7+
8+
module ActiveSupport
9+
end

0 commit comments

Comments
 (0)