8.1.11
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
endOther Bug Fixes
- MONGOID-5874 Fix persisting embedded children (PR)
- MONGOID-5863 last overrides skip (PR)