mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-13 22:53:32 +03:00
b03ecd9ebc
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
20 lines
339 B
JavaScript
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)
|
|
}; |