From d90f2a11ed00ea028fcea21cbfb13499c4794e1e Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Mon, 7 Jul 2025 12:36:13 -0400 Subject: [PATCH 1/4] Fix db cleaner core version to match the other repo --- database_cleaner-active_record.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database_cleaner-active_record.gemspec b/database_cleaner-active_record.gemspec index 8c87e43e..d4bd7885 100644 --- a/database_cleaner-active_record.gemspec +++ b/database_cleaner-active_record.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.executables = [] spec.require_paths = ["lib"] - spec.add_dependency "database_cleaner-core", "~>2.0.0" + spec.add_dependency "database_cleaner-core", "~>2.1.0" spec.add_dependency "activerecord", ">= 5.a" spec.add_development_dependency "bundler" From 8da65a99bd081aa041806841e7aaf98c543e2bf8 Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Mon, 7 Jul 2025 12:45:12 -0400 Subject: [PATCH 2/4] Fix "uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger" error --- gemfiles/rails_6.1.gemfile | 1 + gemfiles/rails_7.0.gemfile | 1 + gemfiles/rails_7.2.gemfile | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile index 35b0ed67..b2cc5cef 100644 --- a/gemfiles/rails_6.1.gemfile +++ b/gemfiles/rails_6.1.gemfile @@ -5,6 +5,7 @@ source "https://rubygems.org" gem "database_cleaner-core", git: "https://github.com/DatabaseCleaner/database_cleaner" gem "rails", "~> 6.1.0" gem "sqlite3", "~> 1.5" +gem "concurrent-ruby", "1.3.4" group :test do gem "simplecov", require: false diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index 3cbf4010..76289d4b 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -5,6 +5,7 @@ source "https://rubygems.org" gem "database_cleaner-core", git: "https://github.com/DatabaseCleaner/database_cleaner" gem "rails", "~> 7.0.0" gem "sqlite3", "~> 1.7" +gem "concurrent-ruby", "1.3.4" group :test do gem "simplecov", require: false diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile index f968a14c..95b90db6 100644 --- a/gemfiles/rails_7.2.gemfile +++ b/gemfiles/rails_7.2.gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" gem "database_cleaner-core", git: "https://github.com/DatabaseCleaner/database_cleaner" -gem "rails", "~> 7.2.0.beta2" +gem "rails", "~> 7.2.0" group :test do gem "simplecov", require: false From 559ad4c1831a376441290b799b549eff04f01f01 Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Mon, 7 Jul 2025 12:45:19 -0400 Subject: [PATCH 3/4] Add CONTRIBUTE.md and docker-compose file with databases setup --- CONTRIBUTE.md | 32 ++++++++++++++++++++++++++++++++ docker-compose.yml | 19 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 CONTRIBUTE.md create mode 100644 docker-compose.yml diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md new file mode 100644 index 00000000..4c0940ce --- /dev/null +++ b/CONTRIBUTE.md @@ -0,0 +1,32 @@ +# Guidelines for contributing + +## 1. Fork & Clone + +Since you probably don't have rights to the main repo, you should Fork it (big +button up top). After that, clone your fork locally and optionally add an +upstream: + + git remote add upstream git@github.com:DatabaseCleaner/database_cleaner-active_record.git + +## 2. Make sure the tests run fine + +The gem uses Appraisal to configure different Gemfiles to test different Rails versions. + +- You can run all the databases through docker if needed with `docker compose up` (you can also have them running on your system, just comment out the ones you don't need from the `docker-compose.yml` file) +- Copy `spec/support/sample.config.yml` to `spec/support/config.yml` and edit it +- `BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle install` (change `6.1` with any version from the `gemfiles` directory) +- `BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle exec rake` + +Note that if you don't have all the supported databases installed and running, +some tests will fail. + +> Note that you can check the `.github/workflows/ci.yml` file for different combinations of Ruby and Rails that are expected to work + +## 3. Prepare your contribution + +This is all up to you but a few points should be kept in mind: + +- Please write tests for your contribution +- Make sure that previous tests still pass +- Push it to a branch of your fork +- Submit a pull request diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..41cf4c22 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +services: + postgres: + image: postgres:16 # specify the version needed for a given app + environment: + - POSTGRES_PASSWORD=postgres # this is required + ports: + - "127.0.0.1:5432:5432" # so we can use `localhost` as the host + mysql: + image: mysql:9.3 + environment: + - MYSQL_ROOT_PASSWORD=mysql + ports: + - "127.0.0.1:3306:3306" + redis: + image: redis:6.2-alpine + restart: always + ports: + - "127.0.0.1:6379:6379" + command: redis-server --save 20 1 --loglevel warning From 62bb6f47f1dd6d2448741648c2d876a798b13aef Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Mon, 7 Jul 2025 12:49:03 -0400 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a936418..d6a9efb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Development (unreleased) +* Fix bundling and CONTRIBUTE.md instructions: https://github.com/DatabaseCleaner/database_cleaner-active_record/pull/123 + ## v2.2.1 2025-05-13 * https://github.com/DatabaseCleaner/database_cleaner-active_record/pull/111 by @tagliala