Ghost/core/server/models/client.js
Hannah Wolfe b03ecd9ebc Use bookshelf's model registry plugin
Refs #2170

This removes the circular dependency problem from our models thanks to
https://github.com/tgriesser/bookshelf/issues/181
- add the registry plugin
- switch all models and collections to be registered
- switch relationships to be defined using a string, which calls from the registry
2014-07-13 18:18:25 +01:00

20 lines
339 B
JavaScript

var ghostBookshelf = require('./base'),
Client,
Clients;
Client = ghostBookshelf.Model.extend({
tableName: 'clients'
});
Clients = ghostBookshelf.Collection.extend({
model: Client
});
module.exports = {
Client: ghostBookshelf.model('Client', Client),
Clients: ghostBookshelf.collection('Clients', Clients)
};