Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let config = {
adapters: {
"sails-disk": sailsDisk
},
connections: {
tmp: {
adapter: "sails-disk"
}
},
defaults: {
migrate: "drop"
}
};
let waterlineInstance = new waterline();
models.forEach(model => {
if (!model.connection) {
model.connection = "tmp";
}
waterlineInstance.loadCollection(waterline.Collection.extend(model));
});
function setupAssociations(models) {
_.each(models, function eachInstantiatedModel(thisModel, modelID) {
// Bind context for models
// (this (breaks?)allows usage with tools like `async`)
_.bindAll(thisModel);
// Derive information about this model's associations from its schema
// and attach/expose the metadata as `SomeModel.associations` (an array)
thisModel.associations = _.reduce(
async createNewInstance () {
this.waterline = new Waterline()
}
import feathers from 'feathers';
import rest from 'feathers-rest';
import bodyParser from 'body-parser';
import Waterline from 'waterline';
import diskAdapter from 'sails-disk';
import waterline from '../lib';
const ORM = new Waterline();
const config = {
adapters: {
'default': diskAdapter,
disk: diskAdapter
},
connections: {
myLocalDisk: {
adapter: 'disk'
}
},
defaults: {
migrate: 'alter'
}
};
const Todo = Waterline.Collection.extend({
identity: 'todo',