diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 52be2d2..9695cda 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,17 +12,25 @@ 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.1', mongoid: '9.0' } + - { 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/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/README.md b/README.md index 51260da..d6207cf 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 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, 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/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 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') %>