From 4a23bfcec32c25826367a397ad0d3e2f43e58bb7 Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Fri, 24 Dec 2021 11:51:59 +0300 Subject: [PATCH 1/4] Test against Rails 7.0 and drop Ruby 2.5 (EOL). --- .github/workflows/ruby.yml | 7 ++++--- Gemfile.rails70 | 6 ++++++ README.md | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 Gemfile.rails70 diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index a48409c..c722939 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -32,11 +32,12 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['2.5', '2.6', '2.7', '3.0.2'] + ruby-version: ['2.6', '2.7', '3.0.2'] gemfile: - Gemfile - Gemfile.rails60 - Gemfile.rails61 + - Gemfile.rails70 - Gemfile.railsmaster - Gemfile.mongo_mapper db: @@ -50,8 +51,8 @@ jobs: gemfile: Gemfile - ruby-version: '3.0.2' gemfile: Gemfile.mongo_mapper - - ruby-version: '2.5' - gemfile: Gemfile.railsmaster + - ruby-version: '2.6' + gemfile: Gemfile.rails70 - ruby-version: '2.6' gemfile: Gemfile.railsmaster env: diff --git a/Gemfile.rails70 b/Gemfile.rails70 new file mode 100644 index 0000000..1724c35 --- /dev/null +++ b/Gemfile.rails70 @@ -0,0 +1,6 @@ +eval_gemfile('Gemfile.global') + +gem 'minitest', '~> 5.8' +gem 'rails', github: 'rails/rails', branch: '7-0-stable', require: false +gem 'mongoid', github: 'mongodb/mongoid' +gem 'sqlite3', :platform => [:ruby, :mswin, :mingw] diff --git a/README.md b/README.md index 80b62c6..653a929 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Or install it yourself as: ## Supported Versions -- Ruby 2.5+ +- Ruby 2.6+ - Rails 5.2+ ## Usage From 3363426969002df05b0df467dc55c8034f6efe05 Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Fri, 24 Dec 2021 11:53:09 +0300 Subject: [PATCH 2/4] Bump version. --- CHANGELOG.md | 2 +- lib/enumerize/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8864a0..37c2c0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## master +## 2.5.0 (December 24, 2021) ### enhancements diff --git a/lib/enumerize/version.rb b/lib/enumerize/version.rb index 23270be..e38b718 100644 --- a/lib/enumerize/version.rb +++ b/lib/enumerize/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Enumerize - VERSION = '2.4.0' + VERSION = '2.5.0' end From 50b5b5093763a9a3c560bbb4cf25e45300e49bac Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Fri, 24 Dec 2021 12:06:38 +0300 Subject: [PATCH 3/4] Do not run mongoid specs for Rails 7 as it's not supported yet. --- Gemfile.rails70 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gemfile.rails70 b/Gemfile.rails70 index 1724c35..7e5f374 100644 --- a/Gemfile.rails70 +++ b/Gemfile.rails70 @@ -2,5 +2,8 @@ eval_gemfile('Gemfile.global') gem 'minitest', '~> 5.8' gem 'rails', github: 'rails/rails', branch: '7-0-stable', require: false -gem 'mongoid', github: 'mongodb/mongoid' + +# TODO: Mongoid doesn't support Rails 7 yet. Uncomment when it's fixed https://jira.mongodb.org/browse/MONGOID-5193 +# gem 'mongoid', github: 'mongodb/mongoid' + gem 'sqlite3', :platform => [:ruby, :mswin, :mingw] From bf927d325e4eba2f64337b557321200db09fa684 Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Fri, 24 Dec 2021 16:45:10 +0300 Subject: [PATCH 4/4] Fix mysql config. --- test/activerecord_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/activerecord_test.rb b/test/activerecord_test.rb index e3ba6eb..46de999 100644 --- a/test/activerecord_test.rb +++ b/test/activerecord_test.rb @@ -38,12 +38,18 @@ 'schema_search_path' => 'public' } } + case db when :postgresql ActiveRecord::Base.establish_connection(:postgresql_master) ActiveRecord::Base.connection.recreate_database('enumerize_test') when :mysql2 - ActiveRecord::Tasks::DatabaseTasks.create ActiveRecord::Base.configurations[db.to_s] + if ActiveRecord::Base.configurations.respond_to?(:[]) + ActiveRecord::Tasks::DatabaseTasks.create ActiveRecord::Base.configurations[db.to_s] + else + ActiveRecord::Tasks::DatabaseTasks.create ActiveRecord::Base.configurations.find_db_config(db.to_s) + end + ActiveRecord::Base.establish_connection(db) else ActiveRecord::Base.establish_connection(db)