Skip to content

Commit

Permalink
remove lingering trailing whitespace from rebase merge
Browse files Browse the repository at this point in the history
  • Loading branch information
partap committed Feb 25, 2015
1 parent 9bf093a commit 96bfac7
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/relation-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ HasMany.prototype.findById = function (fkId, cb) {
filter.where = {};
filter.where[idName] = fkId;
filter.where[fk] = modelInstance[pk];

cb = cb || utils.createPromiseCallback();

if (filter.where[fk] === undefined) {
Expand Down Expand Up @@ -999,7 +999,7 @@ HasManyThrough.prototype.add = function (acInst, data, done) {
data = {};
}
var query = {};

data = data || {};
done = done || utils.createPromiseCallback();

Expand Down Expand Up @@ -1058,7 +1058,7 @@ HasManyThrough.prototype.exists = function (acInst, done) {
var filter = { where: query };

definition.applyScope(this.modelInstance, filter);

done = done || utils.createPromiseCallback();

modelThrough.count(filter.where, function(err, ac) {
Expand Down Expand Up @@ -1092,7 +1092,7 @@ HasManyThrough.prototype.remove = function (acInst, done) {
var filter = { where: query };

definition.applyScope(this.modelInstance, filter);

done = done || utils.createPromiseCallback();

modelThrough.deleteAll(filter.where, function (err) {
Expand Down Expand Up @@ -1226,7 +1226,7 @@ BelongsTo.prototype.create = function(targetModelData, cb) {
targetModelData = {};
}
cb = cb || utils.createPromiseCallback();

this.definition.applyProperties(modelInstance, targetModelData || {});

modelTo.create(targetModelData, function(err, targetModel) {
Expand Down Expand Up @@ -1929,7 +1929,7 @@ EmbedsOne.prototype.create = function (targetModelData, cb) {

targetModelData = targetModelData || {};
cb = cb || utils.createPromiseCallback();

var inst = this.callScopeMethod('build', targetModelData);

var updateEmbedded = function() {
Expand Down Expand Up @@ -2389,7 +2389,7 @@ EmbedsMany.prototype.create = function (targetModelData, cb) {
}
targetModelData = targetModelData || {};
cb = cb || utils.createPromiseCallback();

var embeddedList = this.embeddedList();

var inst = this.callScopeMethod('build', targetModelData);
Expand Down Expand Up @@ -2476,7 +2476,7 @@ EmbedsMany.prototype.add = function (acInst, data, cb) {
data = {};
}
cb = cb || utils.createPromiseCallback();

var self = this;
var definition = this.definition;
var modelTo = this.definition.modelTo;
Expand Down Expand Up @@ -2541,7 +2541,7 @@ EmbedsMany.prototype.remove = function (acInst, cb) {
var filter = { where: query };

belongsTo.applyScope(modelInstance, filter);

cb = cb || utils.createPromiseCallback();

modelInstance[definition.name](filter, function(err, items) {
Expand Down Expand Up @@ -2669,7 +2669,7 @@ ReferencesMany.prototype.related = function(receiver, scopeParams, condOrRefresh
} else {
throw new Error('Method can be only called with one or two arguments');
}

var ids = self[fk] || [];

this.definition.applyScope(modelInstance, actualCond);
Expand Down Expand Up @@ -2698,7 +2698,7 @@ ReferencesMany.prototype.findById = function (fkId, cb) {
var filter = {};

this.definition.applyScope(modelInstance, filter);

cb = cb || utils.createPromiseCallback();

modelTo.findByIds(ids, filter, function (err, instances) {
Expand Down Expand Up @@ -2747,7 +2747,7 @@ ReferencesMany.prototype.updateById = function (fkId, data, cb) {
data = {};
}
cb = cb || utils.createPromiseCallback();

this.findById(fkId, function(err, inst) {
if (err) return cb(err);
inst.updateAttributes(data, cb);
Expand Down Expand Up @@ -2790,7 +2790,7 @@ ReferencesMany.prototype.create = function (targetModelData, cb) {
}
targetModelData = targetModelData || {};
cb = cb || utils.createPromiseCallback();

var ids = modelInstance[fk] || [];

var inst = this.callScopeMethod('build', targetModelData);
Expand Down Expand Up @@ -2859,7 +2859,7 @@ ReferencesMany.prototype.add = function (acInst, cb) {
done(err, err ? null : inst);
});
};

cb = cb || utils.createPromiseCallback();

if (acInst instanceof modelTo) {
Expand Down Expand Up @@ -2895,7 +2895,7 @@ ReferencesMany.prototype.remove = function (acInst, cb) {

var id = (acInst instanceof definition.modelTo) ? acInst[pk] : acInst;
id = id.toString();

cb = cb || utils.createPromiseCallback();

var index = currentIds.indexOf(id);
Expand Down

0 comments on commit 96bfac7

Please sign in to comment.