lykmapipo / sails-hook-validation

Custom validation error messages for sails model with i18n support
104 stars 29 forks source link

Use global lodash instead of sails.util._ if available (Fixes #50) #53

Closed kinsi55 closed 7 years ago

kinsi55 commented 7 years ago

In sails V1 lodash is defined globally and not trough a helper path, this accomodates for both.

kinsi55 commented 7 years ago

Okay turns out theres way more broken in V1. Seems like its also somehow "removing" the meta function from waterline calls.

Model.update(criteria)
    .set(updateValues)
    .meta({fetch: true})
    .exec(cb);

=> TypeError: Model.update(...).set(...).meta is not a function

Anyways, its a start.

Edit: Oh yeah makes sense, because its not built on promises. Todo?