…cur. Note: this does not use ActiveModel::Dirty as ActiveModel::Dirty doesn't find in place changes (such as appending to an array or calling gsub! on a string). Partial Updates can be turned on or off per class (by default they are off): class Person include MongoMapper::Document self.partial_updates = false end
…e can catch and raise errors in safe mode. Closes #398.
…ociations. Closes #352.
…d so often. Remove instance #extends. They torch the ruby method cache! This is Very Very Bad. Don't do identity map stuff when the identity map is disabled. Big changes to load behavior to improve load speeds substantially. The big change here is that when loading from the database, we use an #internal_write_key method that isn't eligible for plugins to overwrite. Previously, things like #dirty_key's write_key would be invoked when loading from the DB, which in turn invoked read_key and a whole other chain of things. This massively slowed down read speeds. Other changes have been made to improve internal_write_key. First off, uncast values are now stored in write (by the app, not the DB), and only then from the Rails plugin, as that's the functionality that is concerned with uncast values. It's now a simple hash lookup rather than being a whole mess of ivars. Keys#keys now copies the class.keys to an ivar when it's used. This method is used very frequently, and avoiding the extra function call has substantial benefit when you start adding it up. is_a? was replaced with instance_of? in a number of places; this is faster when you want to compare types directly, rather than the inheritance hierarchiy. We're testing !foo rather than foo.nil? in a number of places for similar reasons. Several tests which were too brittle have been fixed. These changes have resulted in something approaching a 1000% speed increase when reading from the database. Dirty doesn't need initialize_from_database anymore Since MM depends on activesupport already, just go ahead and include the Time.zone patch so we can remove #try Performance improvements to boolean#from_mongo Eliminate a bunch of uninitialized ivar warnings. Slightly improve the runtime of Key#get by avoiding a few method calls. Remove spec that shouldn't have made it into this branch
…/balexand/mongomapper into balexand-query_methods_match_correct_docs
Upgrade safe semantics to be consistent with the new MongoClient safe semantics - legacy usage (:safe => true) is transparently upgraded to the new system. BIG CHANGE: In keeping with the driver defaults, safety is now ON by default (:w => 1) rather than off by default. Use `safe false` to turn off safety in a model. Fixed tests.
…r, :find_one, :per_page, :ignore, :only to the query. A few user problems are fixed by this. To honor unpersisted documents, the methods without arguments (:size and :empty?) need to hit the loaded association array in the ManyDocumentsProxy instead of going to the database...tests updated to reflect this.
…odule is deprecated
…with < 0.4, plucky changed Query#update to Query#amend)
…to do a lot more work than I was planning on for this.
…luded in associations as well. Also, less using of full module path for includes and such.
…Plucky::Query, it makes more sense to decorate the plucky query with the few pieces we need to work differently.
…e tests that do not really matter.
… bug in Harmony. Can't replicate or figure out so for now I'll move it back as it hurts nothing.
… all saves using a class method. class User include MongoMapper::Document safe end
… and loads model instances instead of hashes as plucky does.
…ing of MM::Document or MM::EmbeddedDocument only call plugins which will make other types of documents easier. Still need to spend some time on the plugin ordering issues.