lykmapipo/sails-hook-validation

error.Errors is empty using associations

Closed this issue · 2 comments

https://github.com/lykmapipo/sails-hook-validation/blob/master/lib/validateCustom.js#L100
When i output newMessage i see the proper message but error.Error is empty. (rather than undefined).

It seems that when validating on an association it will trigger the (in my case) lib/create.js twice.
The first call will define the error because the association has an error.
The 2e call will return an empty object because it will check the orignal model which has no errors.

Using Sails 0.11.0 and version 4.0

@VMBindraban

Am in it..

@VMBindraban

Merged and published.
Check current v0.4.1 in npm.

Thanks for the fix.