Auto-load and register built-in `Checkpoint` model
This commit is contained in:
parent
242b44ed2b
commit
df9fe90d35
|
@ -441,7 +441,7 @@ Change.rectifyAll = function(cb) {
|
|||
Change.getCheckpointModel = function() {
|
||||
var checkpointModel = this.Checkpoint;
|
||||
if(checkpointModel) return checkpointModel;
|
||||
this.checkpoint = checkpointModel = require('./checkpoint').extend('checkpoint');
|
||||
this.checkpoint = checkpointModel = loopback.Checkpoint.extend('checkpoint');
|
||||
assert(this.dataSource, 'Cannot getCheckpointModel(): ' + this.modelName
|
||||
+ ' is not attached to a dataSource');
|
||||
checkpointModel.attachTo(this.dataSource);
|
||||
|
|
|
@ -8,6 +8,7 @@ module.exports = function(loopback) {
|
|||
loopback.ACL = require('../common/models/acl').ACL;
|
||||
loopback.Scope = require('../common/models/acl').Scope;
|
||||
loopback.Change = require('../common/models/change');
|
||||
loopback.Checkpoint = require('../common/models/checkpoint');
|
||||
|
||||
/*!
|
||||
* Automatically attach these models to dataSources
|
||||
|
|
|
@ -2,7 +2,7 @@ var async = require('async');
|
|||
var loopback = require('../');
|
||||
|
||||
// create a unique Checkpoint model
|
||||
var Checkpoint = require('../common/models/checkpoint').extend('TestCheckpoint');
|
||||
var Checkpoint = loopback.Checkpoint.extend('TestCheckpoint');
|
||||
Checkpoint.attachTo(loopback.memory());
|
||||
|
||||
describe('Checkpoint', function() {
|
||||
|
|
Loading…
Reference in New Issue