I've created a selfreferential model in sails and when I try to create some items it works. But when I get to the findAll() method it returns me an empty array. I don't suppose it is a bug because I might failed with creating a selfreferential model. Anyway, if this model is correct, how can I trace when the Sails.js fails at getting items? For creating and getting I use auto routes created by sails (/:controller/:action)
My model (Category):
attributes: {
name: {
type: 'string',
required: true,
notEmpty: true
},
parentCategory: {
model: 'Category',
defaultsTo: null
},
subCategories: {
collection: 'Category',
via: 'parentCategory',
defaultsTo: []
},
products: {
collection: 'Product',
via: 'categories',
defaultsTo: []
}
}