Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/datasource-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Article.create(function(e, article) {
// should be able to attach a data source to an existing model
var modelBuilder = new ModelBuilder();

Color = modelBuilder.define('Color', {
var Color = modelBuilder.define('Color', {
name: String,
});

Expand Down
2 changes: 1 addition & 1 deletion lib/connectors/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ Memory.prototype.replaceOrCreate = function(model, data, options, callback) {
// Calling _createSync to update the collection in a sync way and
// to guarantee to create it in the same turn of even loop
return self._createSync(model, data, function(err, id) {
if (err) return process.nextTick(function() { cb(err); });
if (err) return process.nextTick(function() { callback(err); });
self.saveToFile(id, function(err, id) {
self.setIdValue(model, data, id);
callback(err, self.fromDb(model, data), {isNewInstance: true});
Expand Down
3 changes: 2 additions & 1 deletion test/manipulation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ describe('manipulation', function() {
.catch(done);
});

it('should save throw error on validation', function() {
it('should save throw error on validation', function(done) {
Person.findOne(function(err, p) {
should.not.exist(err);
p.isValid = function(cb) {
Expand All @@ -429,6 +429,7 @@ describe('manipulation', function() {
'throws': true,
});
}).should.throw(ValidationError);
done();
});
});

Expand Down
4 changes: 2 additions & 2 deletions test/persistence-hooks.suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ module.exports = function(dataSource, should, connectorCapabilities) {
});
});

if (!getSchema().connector.replaceById) {
if (!dataSource.connector.replaceById) {
describe.skip('replaceById - not implemented', function() {});
} else {
describe('PersistedModel.prototype.replaceAttributes', function() {
Expand Down Expand Up @@ -2103,7 +2103,7 @@ module.exports = function(dataSource, should, connectorCapabilities) {
});
});

if (!getSchema().connector.replaceById) {
if (!dataSource.connector.replaceById) {
describe.skip('replaceById - not implemented', function() {});
} else {
describe('PersistedModel.replaceOrCreate', function() {
Expand Down