diff --git a/lib/octoball/log_subscriber.rb b/lib/octoball/log_subscriber.rb index 4c5b998..b30dfa3 100644 --- a/lib/octoball/log_subscriber.rb +++ b/lib/octoball/log_subscriber.rb @@ -12,7 +12,11 @@ def sql(event) private def debug(progname = nil, &block) - conn = current_shard ? color("[Shard: #{current_shard}]", ActiveSupport::LogSubscriber::GREEN, true) : '' + if ActiveRecord.gem_version >= Gem::Version.new('7.1.0') + conn = current_shard ? color("[Shard: #{current_shard}]", ActiveSupport::LogSubscriber::GREEN, bold: true) : '' + else + conn = current_shard ? color("[Shard: #{current_shard}]", ActiveSupport::LogSubscriber::GREEN, true) : '' + end super(conn + progname.to_s, &block) end end