Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
32 changes: 32 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion database_cleaner-active_record.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no such version on rubygems: https://rubygems.org/gems/database_cleaner-core

spec.add_dependency "activerecord", ">= 5.a"

spec.add_development_dependency "bundler"
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading