Skip to content

9.0.7

Latest
Compare
Choose a tag to compare
@mongodb-dbx-release-bot mongodb-dbx-release-bot released this 24 Jul 16:36
· 43 commits to master since this release
50a3b72

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

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

gem install -v 9.0.7 mongoid

Or simply add it to your Gemfile:

gem 'mongoid', '9.0.7'

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 example, when a child callback depends simply on the parent having changed state).

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