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.
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