From 2d3065c848c02e4ca6808e6a8e92e52e2c2cdfa6 Mon Sep 17 00:00:00 2001 From: Thomas Oman Date: Fri, 4 Feb 2022 17:24:11 +0000 Subject: [PATCH 1/2] Update MySQL image circleci images are being deprecated, so switch to cimg images --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b900cb2..e9e1340f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ references: - "main" mysql_versions: &mysql_versions - - "5.7.18" + - "5.7" psql_versions: &psql_versions - "9.6" @@ -79,7 +79,7 @@ jobs: CIRCLE_TEST_REPORTS: /tmp/circle_artifacts/ DATABASE_URL: mysql2://foobar:password@127.0.0.1/statesman_test DATABASE_DEPENDENCY_PORT: "3306" - - image: circleci/mysql:<< parameters.mysql_version >> + - image: cimg/mysql:<< parameters.mysql_version >> environment: MYSQL_ROOT_PASSWORD: password MYSQL_USER: foobar From 20be31ec6679c456726c60aa58d5ad1f4f8c3b8c Mon Sep 17 00:00:00 2001 From: Thomas Oman Date: Fri, 4 Feb 2022 17:29:51 +0000 Subject: [PATCH 2/2] Fix Rubocop errors --- lib/statesman/adapters/active_record.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/statesman/adapters/active_record.rb b/lib/statesman/adapters/active_record.rb index 7bdcf92f..f12691a2 100644 --- a/lib/statesman/adapters/active_record.rb +++ b/lib/statesman/adapters/active_record.rb @@ -309,8 +309,11 @@ def updated_column_and_timestamp end def default_timezone - # Rails 7 deprecates ActiveRecord::Base.default_timezone in favour of ActiveRecord.default_timezone - return ::ActiveRecord.default_timezone if ::ActiveRecord.respond_to?(:default_timezone) + # Rails 7 deprecates ActiveRecord::Base.default_timezone + # in favour of ActiveRecord.default_timezone + if ::ActiveRecord.respond_to?(:default_timezone) + return ::ActiveRecord.default_timezone + end ::ActiveRecord::Base.default_timezone end