Skip to content

Commit

Permalink
Fix for proper compatibility with Rails initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
crashtech committed May 24, 2024
1 parent 548d0d2 commit 1196c11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions lib/rails/graphql/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ class Railtie < Rails::Railtie
# Ensure a valid logger
initializer 'graphql.logger' do |app|
ActiveSupport.on_load(:graphql) do
return if config.logger.present?

logger = ::Rails.logger
if logger.respond_to?(:tagged)
config.logger = logger
else
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.logger ||= begin
logger = ::Rails.logger
logger.respond_to?(:tagged) ? logger : ActiveSupport::TaggedLogging.new(logger)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rails/graphql/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.version
module VERSION
MAJOR = 1
MINOR = 0
TINY = 2
TINY = 3
PRE = nil

STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
Expand Down

0 comments on commit 1196c11

Please sign in to comment.