1 | ;
|
2 |
|
3 | module.exports = function(api) {
|
4 |
|
5 | // Base Model
|
6 | api.bookshelf.Model = api.bookshelf.Model.extend({
|
7 |
|
8 | hasTimestamps: true
|
9 | //...
|
10 |
|
11 | }, {
|
12 |
|
13 | find: function(id, options) {
|
14 | if (options == null) { options = {}; }
|
15 | if (!options.require) { options.require = true; }
|
16 | return this.forge({id: id}).fetch(options);
|
17 | }
|
18 | //...
|
19 |
|
20 | });
|
21 |
|
22 |
|
23 | // Base Collection
|
24 | api.bookshelf.Collection = api.bookshelf.Collection.extend({
|
25 |
|
26 | model: api.bookshelf.Model
|
27 |
|
28 | });
|
29 |
|
30 | };
|