From 1ea8b9e37f01ee19e21909214f596f220f31cd0d Mon Sep 17 00:00:00 2001 From: JD Guzman Date: Wed, 2 Dec 2026 17:54:02 +0000 Subject: [PATCH 1/3] Support Mongoid 9 and Rails 8.1 Allow mongoid < 10 and require ransack-mongoid 1.1, which adds Mongoid 9 support. The test app gets a Mongoid 9 config, and CI adds Rails 7.2 and 8.0 on Mongoid 9.0 and Rails 8.1 on Mongoid 9.1 (Rails 8.1 needs Mongoid 9). --- .github/workflows/tests.yml | 11 +++++++++-- README.md | 10 +++++----- activeadmin-mongoid.gemspec | 4 ++-- test_app/config/mongoid.9.yml | 13 +++++++++++++ 4 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 test_app/config/mongoid.9.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 52be2d2..cf31906 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,17 +12,24 @@ jobs: fail-fast: false matrix: ruby: ['3.1', '3.2', '3.3', '3.4', '4.0'] - # Mongoid 7.5 supports Rails up to 7.0; Mongoid 8.1 up to 8.0. + # Mongoid 7.5 supports Rails up to 7.0; Mongoid 8.1 up to 8.0; Mongoid 9 up to 8.1. stack: - { rails: '7.0', mongoid: '7.5' } - { rails: '7.0', mongoid: '8.1' } - { rails: '7.1', mongoid: '8.1' } - { rails: '7.2', mongoid: '8.1' } - { rails: '8.0', mongoid: '8.1' } + - { rails: '7.2', mongoid: '9.0' } + - { rails: '8.0', mongoid: '9.0' } + - { rails: '8.1', mongoid: '9.1' } exclude: - # Rails 8.0 needs Ruby 3.2 or later. + # Rails 8.0 and 8.1 need Ruby 3.2 or later. - ruby: '3.1' stack: { rails: '8.0', mongoid: '8.1' } + - ruby: '3.1' + stack: { rails: '8.0', mongoid: '9.0' } + - ruby: '3.1' + stack: { rails: '8.1', mongoid: '9.1' } # ubuntu-latest (26.04) can't compile native extensions against Ruby 3.2's headers. runs-on: ubuntu-24.04 name: Ruby ${{ matrix.ruby }}, Rails ${{ matrix.stack.rails }}, Mongoid ${{ matrix.stack.mongoid }} diff --git a/README.md b/README.md index 51260da..edb12b2 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,12 @@ ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin application. This repo was pulled into the ActiveAdmin org from previous work done by Elia Schito, and will be maintained by Grzegorz Jakubiak, Nic Boie, JD Guzman, Elia Schito and other ActiveAdmin and community members. -### Requirements for version 3.0.0 -* Ruby 3.1 or greater (Rails 8.0 needs Ruby 3.2 or later). -* Rails 7.0, 7.1, 7.2 or 8.0 -* Mongoid 8.x, or Mongoid 7.5 on Rails 7.0 +### Requirements for version 3.x +* Ruby 3.1 or greater (Rails 8.0 and 8.1 need Ruby 3.2 or later). +* Rails 7.0, 7.1, 7.2, 8.0 or 8.1 +* Mongoid 8.x or 9.x (Rails 8.1 needs Mongoid 9; Mongoid 9 needs activeadmin-mongoid 3.1), or Mongoid 7.5 on Rails 7.0 * ActiveAdmin 3.x (tested on 3.5) -* Ransack 4.x, through [ransack-mongoid](https://github.com/riverock/ransack-mongoid) 1.x, which this gem depends on. Your application should use Mongoid only (see the ransack-mongoid README). +* Ransack 4.x, through [ransack-mongoid](https://github.com/riverock/ransack-mongoid) 1.x (1.1 or later for Mongoid 9), which this gem depends on. Your application should use Mongoid only (see the ransack-mongoid README). See [CHANGELOG.md](CHANGELOG.md) for the changes from 2.0.0. Use 2.x with ActiveAdmin 2. diff --git a/activeadmin-mongoid.gemspec b/activeadmin-mongoid.gemspec index 0ff08cd..60956bc 100644 --- a/activeadmin-mongoid.gemspec +++ b/activeadmin-mongoid.gemspec @@ -17,9 +17,9 @@ Gem::Specification.new do |gem| gem.required_ruby_version = '>= 3.1' - gem.add_runtime_dependency 'mongoid', '>= 7.5', '< 9' + gem.add_runtime_dependency 'mongoid', '>= 7.5', '< 10' gem.add_runtime_dependency 'activeadmin', '~> 3.0' - gem.add_runtime_dependency 'ransack-mongoid', '~> 1.0' # Mongoid support for Ransack 4, which ActiveAdmin 3 requires + gem.add_runtime_dependency 'ransack-mongoid', '~> 1.1' # Mongoid support for Ransack 4, which ActiveAdmin 3 requires gem.add_runtime_dependency 'csv' # the CSV builder; no longer a default gem from Ruby 3.4 gem.add_runtime_dependency 'kaminari-mongoid' gem.add_runtime_dependency 'jquery-rails' diff --git a/test_app/config/mongoid.9.yml b/test_app/config/mongoid.9.yml new file mode 100644 index 0000000..2147dfd --- /dev/null +++ b/test_app/config/mongoid.9.yml @@ -0,0 +1,13 @@ +development: + clients: + default: + database: activeadmin_mongoid_development + hosts: + - <%= ENV.fetch('MONGODB_HOST', 'localhost:27017') %> + +test: + clients: + default: + database: activeadmin_mongoid_test + hosts: + - <%= ENV.fetch('MONGODB_HOST', 'localhost:27017') %> From e4cbd4a181731e9ee03c0ec10fbdffbd7335c24e Mon Sep 17 00:00:00 2001 From: JD Guzman Date: Wed, 2 Dec 2026 20:22:30 +0000 Subject: [PATCH 2/3] Test Mongoid 9 on Rails 7.1 and clarify the Mongoid 9 requirement The gemspec allows Mongoid 9 with Rails 7.1, so CI tests that pair too. --- .github/workflows/tests.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cf31906..9695cda 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,6 +19,7 @@ jobs: - { rails: '7.1', mongoid: '8.1' } - { rails: '7.2', mongoid: '8.1' } - { rails: '8.0', mongoid: '8.1' } + - { rails: '7.1', mongoid: '9.0' } - { rails: '7.2', mongoid: '9.0' } - { rails: '8.0', mongoid: '9.0' } - { rails: '8.1', mongoid: '9.1' } diff --git a/README.md b/README.md index edb12b2..d6207cf 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin ### Requirements for version 3.x * Ruby 3.1 or greater (Rails 8.0 and 8.1 need Ruby 3.2 or later). * Rails 7.0, 7.1, 7.2, 8.0 or 8.1 -* Mongoid 8.x or 9.x (Rails 8.1 needs Mongoid 9; Mongoid 9 needs activeadmin-mongoid 3.1), or Mongoid 7.5 on Rails 7.0 +* Mongoid 8.x, or Mongoid 9.x from version 3.1 (Rails 8.1 needs Mongoid 9), or Mongoid 7.5 on Rails 7.0 * ActiveAdmin 3.x (tested on 3.5) * Ransack 4.x, through [ransack-mongoid](https://github.com/riverock/ransack-mongoid) 1.x (1.1 or later for Mongoid 9), which this gem depends on. Your application should use Mongoid only (see the ransack-mongoid README). From 924dc5e4fb8345ddc7e93cf7027570220a45deaf Mon Sep 17 00:00:00 2001 From: JD Guzman Date: Wed, 2 Dec 2026 17:54:02 +0000 Subject: [PATCH 3/3] Release 3.1.0 --- CHANGELOG.md | 6 ++++++ lib/active_admin/mongoid/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf3c3e..c75d623 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 3.1.0 + +* Supports Mongoid 9 and Rails 8.1 (Rails 8.1 needs Mongoid 9). The `mongoid` dependency is now + >= 7.5, < 10. +* Requires ransack-mongoid 1.1, which adds Mongoid 9 support. + ## 3.0.0 Supports ActiveAdmin 3 with Ransack 4, on Ruby 3.1+, Rails 7.0 to 8.0, and Mongoid 8 (or Mongoid 7.5 diff --git a/lib/active_admin/mongoid/version.rb b/lib/active_admin/mongoid/version.rb index 917ca2c..71fcc30 100644 --- a/lib/active_admin/mongoid/version.rb +++ b/lib/active_admin/mongoid/version.rb @@ -1,5 +1,5 @@ module ActiveAdmin module Mongoid - VERSION = '3.0.0' + VERSION = '3.1.0' end end