Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

236 lines (171 sloc) 7.006 kb
=== 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
Jump to Line
Something went wrong with that request. Please try again.