diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a93641..d6a9efb 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 diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md new file mode 100644 index 0000000..4c0940c --- /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/database_cleaner-active_record.gemspec b/database_cleaner-active_record.gemspec index 8c87e43..d4bd788 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" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..41cf4c2 --- /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 diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile index 35b0ed6..b2cc5ce 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 3cbf401..76289d4 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 f968a14..95b90db 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