Setter rewrite - #1
Open
bnoguchi wants to merge 77 commits into
Open
Conversation
…of the type (this is advertised as behavior in the README but actually wasn't implemented yet).
…being called but wasn't defined. Improved some code.
…nstead of prop. i is undefined on use. intentions was prop.
Conflicts: lib/mongoose/document.js lib/mongoose/schema.js
Conflicts: lib/mongoose/index.js lib/mongoose/type.js tests/document.js tests/types.js
… using type('array'), which referenced the wrong kind of object.
Conflicts: lib/mongoose/types.js tests/types.js
…after saving a new record.
guess it is nice if you *do* have a larger data set, guess you could always re limit(1) I dunno
…t are TypeSchema instances. Before, this.extend was the used strategy. Now, we keep track of the subtype in the EmbeddedArray instance and handle accordingly. Got most of the tests passing (except for one or more in schema.js testing).
Conflicts: lib/mongoose/document.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moved type specific setter logic to the specific type definitions (where I think it should be). Added a 2 new methods, _pre and flagDirty to TypeSchema.prototype to make this easier. All setting logic now takes place in Document.prototype.set, which also can accept a hydration flag or not. Document.prototype._setData now delegates to Document.prototype.set and only (1) determines the appropriate parameters to pass to it and (2) takes care of default values.
Tests seem to behave like before.