#1116 Embedded children retain reference to parent in destroy callbacks.
📇 #1110, #1115 Don't memoize metadata related helpers on documents.
db:create_indexesno longer indexes subclasses multiple times.
#1111, #1098 Don't set
⚡️ #1007 Update attribute properly tracks array changes.
🚀 This was a specific release to get a Psych generated gemspec so no more parse errors would occur on those rubies that were using the new YAML parser.
🛠 #1109 Fixed validations not loading one to ones into memory.
#1107 Mongoid no longer wants required
🛠 #1102 Fixed nested attributes deletion.
#1097 Reload now runs
#1079 Embeds many no longer duplicates documents.
🛠 #1078 Fixed array criteria matching on embedded documents.
#1028 Implement scoped on one-to-many and many-to-many relations.
#988 Many-to-many clear no longer deletes the child documents.
#977 Autosaving relations works also through nested attributes.
#972 Recursive embedding now handles namespacing on generated names.
#943 Don't override
#893 Verify count is not caching on many to many relations.
after_initializeis run in the correct place.
any_ofscopes chain properly with any other scope.
🛠 #776 Fixed mongoid case quality when dealing with subclasses.
🛠 #747 Fixed complex criteria using its keys to render its string value.
#safelynow properly raises validation errors when they occur.
counton criteria. (Adam Greene)
0️⃣ #1044 When multiple relations are defined for the same class, always return the default inverse first if
inverse_ofis not defined.
#710 Nested attributes accept both
_idin hashes or arrays.
nilvalues passed to
embeds_manpushes and substitution. (Derick Bailey)
#1021, #719 Many to many relations dont trigger extra database queries when pushing new documents.
createon large associations does not load the entire relation.
model#update_attributenow can update booleans to
#618 Crack XML library breaks Mongoid by adding
#attributesmethod to the
Stringclass. (Stephen McGinty)
👍 Mongoid now requires MongoDB 1.8.x in order to properly support the
🚚 Traditional slave support has been removed from Mongoid. Replica sets should be used in place of traditional master and slave setups.
👀 Custom field serialization has changed. Please see serializable for changes.
🛠 The dirty attribute tracking has been switched to use ActiveModel, this brings many bug fixes and changes:
- #756 After callbacks and observers see what was changed instead of changes just made being in previous_changes
- #434 Documents now are flagged as dirty when brand new or the state on instantiation differs from the database state. This is consistent with ActiveRecord.
- #323 Mongoid now supports [field]_will_change! from ActiveModel::Dirty
0️⃣ Mongoid model preloading in development mode now defaults to
:autosave => trueon relational associations now saves on update as well as create.
Mongoid now has an identity map for simple
find_by_idqueries. See the website for documentation.
🆕 New Features
#1067 Fields now accept a
:versionedattribute to be able to disable what fields are versioned with
Mongoid::Versioning. (Jim Benton)
#587 Added order preference to many and many to many associations. (Gregory Man)
➕ Added ability to chain
order_bystatements. (Gregory Man)
#961 Allow arbitrary
Mongo::Connectionoptions to pass through
Mongoid::Config::Databaseobject. (Morgan Nelson)
autosavefor many to many references. (Dave Krupinski)
The following explicit atomic operations have been added:
➕ Added exception translations for Hindi. (Sukeerthi Adiga)
attribute_present?to work correctly then attribute value is
false, thanks to @nickhoffman. (Gregory Man)
#960 create indexes rake task is not recognizing a lot of mongoid models because it has problems guessing their model names from filenames. (Tobias Schlottke)
#874 Deleting from a M-M reference is one-sided. (nickhoffman, davekrupinski)
class_inheritable_hashdropped in Rails 3.1+. (Konstantin Shabanov)
🛠 Fix inconsistent state when replacing an entire many to many relation.
Don't clobber inheritable attributes when adding subclass field inheritance. (Dave Krupinski)
#914 Querying embedded documents with
$orselector. (Max Golovnia)
#514 Fix marshaling of documents with relation extensions. (Chris Griego)
Metadata#extensionnow returns a
Module, instead of a
Proc, when an extension is defined.
allow_dynamic_fieldsis set to
falseand loading an embedded document with an unrecognized field, an exception is raised.
#963 Initializing array of embedded documents via hash regressed (Chris Griego, Morgan Nelson)
Mongoid::Config.resetresets the options to their default values.
Mongoid::Fields.defaultsis memoized for faster instantiation of models.