From 0b9e960bf21c50b74c842d249b332dcc1e3456d6 Mon Sep 17 00:00:00 2001 From: Matko Abramovic Date: Mon, 13 Jan 2025 11:17:28 +0100 Subject: [PATCH] Fix checking of Rails version on ActiveRecord log subscriber Don't check only for Rails 7, check for all version after also (Rails 8 and the future ones). --- lib/rails_semantic_logger/active_record/log_subscriber.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rails_semantic_logger/active_record/log_subscriber.rb b/lib/rails_semantic_logger/active_record/log_subscriber.rb index 357303b..d0cd950 100644 --- a/lib/rails_semantic_logger/active_record/log_subscriber.rb +++ b/lib/rails_semantic_logger/active_record/log_subscriber.rb @@ -196,8 +196,8 @@ def type_casted_binds_v5_1_5(casted_binds) alias bind_values bind_values_v5_0_3 alias render_bind render_bind_v5_0_3 alias type_casted_binds type_casted_binds_v5_0_3 - elsif (Rails::VERSION::MAJOR == 6 && Rails::VERSION::MINOR > 0) || # ~> 6.1.0 - Rails::VERSION::MAJOR == 7 + elsif (Rails::VERSION::MAJOR == 6 && Rails::VERSION::MINOR > 0) || + Rails::VERSION::MAJOR >= 7 # ~> 6.1.0 && >= 7.x.x alias bind_values bind_values_v6_1 alias render_bind render_bind_v6_1 alias type_casted_binds type_casted_binds_v5_1_5