Skip to content

Support Mongoid 9 and Rails 8.1 (3.1.0) - #178

Merged
jdguzman merged 3 commits into
masterfrom
jd/mongoid-9
Dec 2, 2026
Merged

jdguzman merged 3 commits into
masterfrom
jd/mongoid-9

Conversation

@jdguzman

@jdguzman jdguzman commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Adds Mongoid 9 and Rails 8.1 support, released as 3.1.0.

No library changes were needed. The adapter passes unchanged on Mongoid 9.0 and 9.1.

  • gemspec: mongoid is now >= 7.5, < 10, and ransack-mongoid is ~> 1.1. ransack-mongoid 1.1 adds Mongoid 9 support (Support Mongoid 9 (1.1.0) riverock/ransack-mongoid#5).
  • Test app: adds config/mongoid.9.yml.
  • 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, and Mongoid 8.1 caps activemodel below 8.1. That makes 42 jobs, including Rails 7.1 on Mongoid 9.0.
  • README and CHANGELOG: updated for 3.1.0.

Run locally, all 31 examples pass on Rails 8.1 + Mongoid 9.1 (Ruby 3.2, 3.3, 3.4 and 4.0), Rails 8.0 + Mongoid 9.0, and Rails 7.2 + Mongoid 9.0 (Ruby 3.1 and 3.4). They also pass on spot checks of the existing rows.

The 3.0.1 follow-ups (#175, #176, #177) aren't included.

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).

@boie0025 boie0025 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving, on the condition you already gave: drop 148454c (the TEMPORARY ransack-mongoid branch pin in the Gemfile) once ransack-mongoid 1.1.0 is on RubyGems, and re-run CI against the released gem before merging. Otherwise master's Gemfile would point at a branch that's about to be deleted.

The rest looks good:

  • mongoid < 10 and ransack-mongoid ~> 1.1 go together. Requiring 1.1 means Bundler can't pair Mongoid 9 with ransack-mongoid 1.0, which caps Mongoid below 9.
  • The CSV export's query-cache fallback is still safe on Mongoid 9. Mongoid::QueryCache was removed there, but Mongoid 9 requires a driver that has Mongo::QueryCache, so the defined? check always picks the driver's.

Two small things, neither blocking:

  1. The gemspec now allows Mongoid 9 on Rails 7.0 and 7.1, but the matrix only runs Mongoid 9 on Rails 7.2, 8.0 and 8.1. Either add a { rails: '7.1', mongoid: '9.0' } row or say in the README that Mongoid 9 is tested from Rails 7.2.
  2. The README requirement "Mongoid 9 needs activeadmin-mongoid 3.1" is a bit circular in a section headed "Requirements for version 3.x". Something like "Mongoid 9 needs 3.1 or later" would read more clearly.

The gemspec allows Mongoid 9 with Rails 7.1, so CI tests that pair too.
@jdguzman

jdguzman commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Thanks. ransack-mongoid 1.1.0 is on RubyGems, so the condition is met:

  • Dropped 148454c (the temporary branch pin). The Gemfile has no ransack-mongoid line again. The gem comes from the gemspec's ~> 1.1 and resolves to the released 1.1.0. CI is re-running against it.
  • Mongoid 9 on Rails 7.1: added a { rails: '7.1', mongoid: '9.0' } row. It passes locally, 31/31 on Ruby 3.1 and 3.4.
  • README: the requirement now reads "Mongoid 8.x, or Mongoid 9.x from version 3.1 (Rails 8.1 needs Mongoid 9)…".

The branch now has three commits:

  • 1ea8b9e Support Mongoid 9 and Rails 8.1
  • e4cbd4a the CI row and README wording
  • 924dc5e Release 3.1.0

@jdguzman
jdguzman merged commit 2bf41ce into master Dec 2, 2026
43 checks passed
@jdguzman
jdguzman deleted the jd/mongoid-9 branch December 2, 2026 21:10
@jdguzman
jdguzman restored the jd/mongoid-9 branch December 2, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants