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
- MONGOID-5843 Ensure BSON::Decimal128 is considered to be numeric (PR)
- MONGOID-5874 Fix persisting embedded children (PR)
- MONGOID-5863 last overrides skip (PR)