Skip to content

Conversation

@jamis
Copy link
Contributor

@jamis jamis commented Jul 24, 2025

The MongoDB Ruby team is pleased to announce version 8.1.11 of the mongoid gem - a Ruby ODM for MongoDB. This is a new patch release in the 8.1.x series of Mongoid.

Install this release using RubyGems via the command line as follows:

gem install -v 8.1.11 mongoid

Or simply add it to your Gemfile:

gem 'mongoid', '8.1.11'

Have any feedback? Click on through to MongoDB's JIRA and open a new ticket to let us know what's on your mind 🧠.

Bug Fixes

MONGOID-5848 Revert MONGOID-5822 (PR)

MONGOID-5822 attempted to fix a regression where child callbacks that depended on parent state were no longer invoked if the child had not changed. However, the fix itself introduced an unacceptable performance regression.

This PR restores the earlier functionality, which will break apps that depend on callbacks being invoked on unmodified children.

For now, the correct way to implement that behavior is to explicitly iterate over the children in a parent callback, e.g.:

class Parent
  include Mongoid::Document
  has_many :children
  after_save { children.each(&:parent_changed_callback) }
end

class Child
  include Mongoid::Document
  belongs_to :parent
  
  def parent_changed_callback
    # ...
  end
end

Other Bug Fixes

@jamis jamis added the release-candidate The PR represents a potential candidate for a new release label Jul 24, 2025
@jamis jamis merged commit 450a5c0 into mongodb:8.1-stable Jul 24, 2025
48 of 50 checks passed
@jamis jamis deleted the rc-8.1.11 branch July 24, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-candidate The PR represents a potential candidate for a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants