leepowelldev / mongoose-validator

Validators for mongoose models utilising validator.js
MIT License
379 stars 43 forks source link

Support mongoose 3.9.7 extended error properties. #26

Closed rodriguise closed 9 years ago

rodriguise commented 9 years ago

Added underscore to ease extending the validator object with additional properties from the options object. This is directly compatible with mongoose 3.9.7 and later.

leepowelldev commented 9 years ago

Great. Would you mind adding a test too?

On 5 Mar 2015, at 17:10, Rob Rodriguez notifications@github.com wrote:

Added underscore to ease extending the validator object with additional properties from the options object. This is directly compatible with mongoose 3.9.7 and later.

You can view, comment on, or merge this pull request online at:

https://github.com/leepowellcouk/mongoose-validator/pull/26

Commit Summary

Adding optional type to validator error Extending validator object with additional attributes to support mongoose ^3.9.7 extended errors Extending validator object with additional attributes to support mongoose ^3.9.7 extended errors Update README.md File Changes

M README.md (14) M lib/mongoose-validator.js (8) M package.json (1) Patch Links:

https://github.com/leepowellcouk/mongoose-validator/pull/26.patch https://github.com/leepowellcouk/mongoose-validator/pull/26.diff — Reply to this email directly or view it on GitHub.

leepowelldev commented 9 years ago

Sorry, I'm going to close this pull request. I've looked into this a bit more and believe this overloads Mongooses internal validate method. I am however, going to be adding support for type - but that's as far as I believe it should go.

leepowelldev commented 9 years ago

I'm going to reopen this request. I've just discovered that in this article http://thecodebarbarian.com/2014/12/19/mongoose-397 extended properties are indeed supported. My mistake. Sadly this doesn't seem to be documented anywhere else.

@rodriguise - I can't do a straight merge as it seems this pull request repo has now been deleted. I'll take the changes from the files marked here though.