=== 1.2.0 - Fixed composite key generation not to replace all special chars with dashes. - Memory optimizations, now wrapping the mongo cursor. - Fixed memoization on has_many_related assocations. - Fixed pagination on embedded associations - Fixed after_update callback not getting fired. - When a connection failure occurs, Mongoid tried to retry the operation up to a configurable time. - Mongoid now supports a configuration with a master and multiple read slaves. It will direct all writes to the master and all reads to the slaves. In the case of a write, subsequent reads will be directed to the master up to configurable number to try and counter the 2 second slave sync delay. - Fixed issue with criteria exclusion queries with ids. - Mongoid only executes a count when explicitly paginating. - Fixed Criteria offset to be a getter or setter - Added indexes to foreign keys on belongs_to_related associations. - General code refactorings/cleanup === 1.1.4 - Refactorings in preparation for next feature push. - Associations may now have anonymous extensions. - Ruby 1.9 compatibility updates. (brainopia) - Document.to_json accepts options. (jsmestad) === 1.1.3 - Nil can be passed into methods that set attributes. - Mongoid.config can now take a block. - Allow named_scopes and criteria class methods on has_many_related if related is a Mongoid document. - Document.find can now take an array of ids. === 1.1.2 - Fixing issues with updates to parents. === 1.1.1 - Document.create raises validations error, not no method error on self.errors (Rick Frankel) - Support default values that respond_to?(:call) (procs/lambda) (ahoward) - Added Mongoid.persist_in_safe_mode global config option. - Minor optimization: don't evaluate default procs if it's not needed (brainopia) === 1.1.0 - Nil attributes no longer persist nil values to the database - the field will just not exist. - create! and save! will now properly raise an error when a database operation fails. This is handled by using :safe => true as an option to collection.save. - Setting blank numbers casts to nil. - Criteria and named scopes can now be used on has many relationships. They can be chained with each other off the association chain. - Mongoid can now determine if a document matches a mongodb selector without hitting the database via Document#matches?(selector). - Overall performance improvements in all areas. - Ruby 1.9 compatibility fixes. - Has many related now supports finding by id or by an optional :all, :first, :last with a conditions hash. === 1.0.6 - Preventing the setting of empty values in attributes. - Better inspect formatting === 1.0.5 - Has one and has many associations now set the parent object first before writing the attributes on #build and #create. === 1.0.4 - Modified criteria to use the querying class when instantiating documents if there are no subclasses. - Floats that are empty strings or nil get defaulted to 0.0 === 1.0.3 - Small performance improvements on finders - Float.set allows setting of non-numeric string in order for validates_numericality_of to fail properly. === 1.0.2 - Named scopes get added functionality: - named scopes can now be criteria objects. - named scoped can now be procs with criteria. - named scopes and class methods that return criteria can be chained with each other. - When calling save on an embedded document whose validation passes but the parent's validation fails, it will properly return false. === 1.0.1 - Documents now have named_scopes similar to ActiveRecord named scopes. Please see rdoc or specs for examples. - Document#to_json properly works in all cases. - ActiveSupport calls for inflections have been moved into the String::Inflections module. - Updated dependency on Validatable to 2.0.1 === 1.0.0 - Validations cleanup: Only before_validation and after_validation callbacks are supported now. - Dynamic fields have reader and writer methods again, but only for instances where the dynamic attribute exists. - Lots of refactoring, mostly coverting common fucntionality into modules for the upcoming rails 2 and 3 gem split. === 0.12.0 - Has one now works as expected: - Has one associations will return nil, instead of the proxy if the association has not been set. - Building/creating a has one is no longer handled by calling the Document#association#build() or create(), this is now handled by Document#build_name and Document#create_name where "name" is the name of the has one association. - Passing a _type attribute to the #build_name and #create_name methods will build/create objects of that type, useful for creating specific subclasses. - The existing #build and #create methods will be removed in the next release. - Removed all dynamic finders. If you need to have functionality similar to "find_or_(create|initialize)_by" you can use the 2 new finders: - Document.find_or_create_by(attributes): Will look for a document in the database with the supplied attributes, if found it will return the document otherwise will create a new one with the supplied attributes. - Document.find_or_initialize_by(attributes): Will look for a document in the database with the supplied attributes, if found it will return the document otherwise will instantiate a new one with the supplied attributes. - Fixed issue with empty hashes and arrays not getting set on document instantiation. === 0.11.9 - Fixed issue with non-us time zones and formats parsing incorrectly. - Fixed error when specifying field restrictions in criteria and not providing the _type. It will now automaticall get added if it is not present. - Slight cleanup of delegated methods in Document. - Dynamic attributes no longer create setters and getters on the class. They can be accessed from the attributes hash directly. If they are used frequently it is preferrable to just add a field to the class manually. - Criteria#min no longer always returns 0.0. === 0.11.8 - Added #min and #max to criteria which takes a single field argument. === 0.11.7 - Added #sum to criteria which takes a single field to aggregate on. Example: Person.sum(:age) would return a float that was the sum of all people's ages in the db. - Fixed issue with queries from parent classes always casting the returned documents to the parent. - Fixed singleton require issue. - Group queries now run as db commands === 0.11.6 - Allow namespaced documents to default with: "namespace_modelname" - Fixed indexing of _type field to only happen on root classes. - Fixed creation of empty collections for embedded documents. - Document.store_in now properly resets the collection if the collection had already been accessed. - Document.find(nil) now raises Mongoid::Errors::InvalidOptions === 0.11.5 - Removed dependency on mongo_ext, since latest version was breaking on various operating systems. === 0.11.4 - Fixed issue with dynamic fields: checking whether the document responded to the attribute's method should have checked the setter and not the getter - Fixed has_one associations not being able to be set to nil. === 0.11.3 - Fixed issue with Document#save! not calling before and after create callbacks if document is new === 0.11.2 - Fixing bug where has many and has one relational associations create method did not return the associated document === 0.11.1 - Querying for classes that have subclasses will also return the subclasses as well, similar to ActiveRecord. - Adding configuration option allow_dynamic_fields. This defaults to true and if set to false will raise an error when trying to set an attribute on an object that does not have a corresponding field defined. === 0.11.0 - Set the collection name to store a document in via: Document.store_in :collection_name - Initial inheritance support: - Documents and their associations can now have an infinite number of subclasses. - Has many and has one associations can build or create specific subclasses by providing an optional class as the last parameter to the #create and #build methods on the respective associations. - Querying for specific subclasses will only return those documents which were saved as that subclass, even though the hierarchy is stored in the same collection. - Deletion of subclass documents will only delete documents of that type, even though they all exist in the same collection. #delete_all and #destroy_all also support this behavoir. - Updated mongo and mongo_ext dependencies to 0.18.2 - Fixed save on new documents to return true instead of the document itself. === 0.10.6 - Fixed bug when trying to set empty strings on number fields. (TypeError: can't convert Fixnum into String) - Document.delete_all now drops the collection if conditions are empty or nil. === 0.10.5 - Documents that are embedded not properly respond to Document#destroy and Document#delete. - Documents can now be saved sans validation with Document#save(false) === 0.10.4 - Documents no longer inherit from Mongoid::Document. Please include Mongoid::Document in all your models now. - Config module added, you can now set one option: Mongoid.raise_not_found_error = (true|false) - When set to false, a Mongoid::Errors::DocumentNotFound will NOT get thrown when performing a Document.find(id) that does not return a document from the database. This defaults to true. - Mongoid::Document.collection_name macro added. You can now set the name of the database collection to persist to. - Mongoid::Criteria#select becomes Mongoid::Criteria#only