Skip to content

Commit df2f566

Browse files
committed
Make changes backward compatible with Rails pre-7.1
1 parent 34e9f8e commit df2f566

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/graphiti.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ def self.logger=(val)
8383
end
8484

8585
def self.log(msg, color = :white, bold = false)
86-
colored = ActiveSupport::LogSubscriber.new.send(:color, msg, color, bold: bold)
86+
if ::Rails::VERSION::MAJOR >= 7 && ::Rails::VERSION::MINOR >= 1
87+
colored = ActiveSupport::LogSubscriber.new.send(:color, msg, color, bold: bold)
88+
else
89+
colored = ActiveSupport::LogSubscriber.new.send(:color, msg, color, bold)
90+
end
91+
8792
logger.debug(colored)
8893
end
8994

0 commit comments

Comments
 (0)