Question

<leolrrj> I’ve enum at my model and I want to retrieve it values… there’s a way?

Answer

Sails stores the models under sails.models. For those of you that have the models option set to true in the globals.js config, User.find() could also be written as sails.models.user.find().

Once initialised, the model becomes an object where one of its properties is definition. So in order to retrieve the model’s definition, and in this specific case, the values for the enum, you could simply use sails.models.user.definition.enumfield to retrieve the values.