@dhyasama/totem-models 7.42.0 → 7.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Deal.js CHANGED
@@ -333,13 +333,13 @@ module.exports = function(mongoose, config) {
333
333
 
334
334
  deal.history = deal.history || [];
335
335
 
336
- deal.history = deal.history.concat([{
336
+ deal.history.push({
337
337
  timestamp: new Date(),
338
338
  account: user,
339
339
  stage: deal.stage,
340
340
  fundraise: deal.fundraise,
341
341
  description: description
342
- }]);
342
+ });
343
343
 
344
344
  }
345
345
 
@@ -345,7 +345,7 @@ module.exports = function(mongoose, config) {
345
345
  return personId.toString() == idOfPersonToAdd.toString();
346
346
  });
347
347
 
348
- if (!match) this.people = this.people.concat([idOfPersonToAdd]);
348
+ if (!match) this.people.push(idOfPersonToAdd);
349
349
 
350
350
  };
351
351
 
@@ -454,14 +454,8 @@ module.exports = function(mongoose, config) {
454
454
  query.exec(cb);
455
455
  };
456
456
 
457
- if (CUSTOMER_ID == 'GLOBAL_PROCESS') {
458
- query = self.find({'name': lpName}, this.getReadFilterKeys(role))
459
- getLps();
460
- }
461
- else {
462
- query = self.find({'customer': customerId, 'name': lpName, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
463
- getLps();
464
- }
457
+ query = self.find({'customer': customerId, 'name': lpName, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
458
+ getLps();
465
459
 
466
460
  };
467
461
 
package/lib/List.js CHANGED
@@ -95,7 +95,7 @@ module.exports = function(mongoose, config) {
95
95
  if (err) return cb(err, null);
96
96
  if (!result) return cb(null, null);
97
97
 
98
- result[collection] = result.collection.concat([itemId]);
98
+ result[collection].push(itemId);
99
99
 
100
100
  result.save(cb);
101
101
 
@@ -570,7 +570,7 @@ module.exports = function(mongoose, config) {
570
570
  // Add website to website aliases
571
571
  // There are unique constraints on website and website aliases
572
572
  // This enables us to enforce uniqueness across both and across documents
573
- if (obj.website && obj.websiteAliases) obj.websiteAliases = obj.websiteAliases.concat([obj.website]);
573
+ if (obj.website && obj.websiteAliases) obj.websiteAliases.push(obj.website);
574
574
 
575
575
  if (obj.websiteAliases) {
576
576
  obj.websiteAliases = _.uniq(obj.websiteAliases);
@@ -1068,7 +1068,7 @@ module.exports = function(mongoose, config) {
1068
1068
  if (dealMatch) { dealMatch = deal; }
1069
1069
 
1070
1070
  // Add the deal
1071
- else self.deals = self.deals.concat([deal]);
1071
+ else { self.deals.push(deal); }
1072
1072
 
1073
1073
  };
1074
1074
 
@@ -1089,7 +1089,7 @@ module.exports = function(mongoose, config) {
1089
1089
  });
1090
1090
 
1091
1091
  // If not, add it
1092
- if (!match) self.people = self.people.concat([personToAdd]);
1092
+ if (!match) self.people.push(personToAdd);
1093
1093
 
1094
1094
  };
1095
1095
 
@@ -1117,7 +1117,7 @@ module.exports = function(mongoose, config) {
1117
1117
  return orgId.toString() == id.toString();
1118
1118
  });
1119
1119
 
1120
- if (!match) self.related = self.related.concat([id]);
1120
+ if (!match) { self.related.push(id); }
1121
1121
 
1122
1122
  };
1123
1123
 
@@ -1202,7 +1202,7 @@ module.exports = function(mongoose, config) {
1202
1202
 
1203
1203
  var addDealToOrg = function addDealToOrg(previous, callback) {
1204
1204
 
1205
- previous.org.deals = previous.org.deals.concat([previous.deal]);
1205
+ previous.org.deals.push(previous.deal);
1206
1206
 
1207
1207
  self.upsert(previous.org, previous.user.username, function(err, result) {
1208
1208
 
package/lib/Person.js CHANGED
@@ -233,7 +233,7 @@ module.exports = function(mongoose, config) {
233
233
  };
234
234
 
235
235
  Person.methods.relatePerson = function(id) {
236
- this.related = this.related.concat([id]);
236
+ this.related.push(id);
237
237
  };
238
238
 
239
239
  Person.methods.addChairPos = function(chairObj, orgId) {
@@ -245,11 +245,11 @@ module.exports = function(mongoose, config) {
245
245
 
246
246
  switch(chairObj.num) {
247
247
  case 'chair1':
248
- this.chairs.first = this.chairs.first.concat([chair]);
248
+ this.chairs.first.push(chair);
249
249
  break;
250
250
 
251
251
  case 'chair2':
252
- this.chairs.second = this.chairs.second.concat([chair]);
252
+ this.chairs.second.push(chair);
253
253
  break;
254
254
  }
255
255
 
@@ -276,12 +276,12 @@ module.exports = function(mongoose, config) {
276
276
  }
277
277
 
278
278
  if(chairObj.val && chairObj.val == "") {
279
- this.previous = this.previous.concat([{
279
+ this.previous.push({
280
280
  field: field,
281
281
  value: {
282
282
  company: orgId
283
283
  }
284
- }]);
284
+ });
285
285
  }
286
286
 
287
287
  };
@@ -459,7 +459,7 @@ module.exports = function(mongoose, config) {
459
459
 
460
460
  if (validator.isEmail(data.rawQuery)) {
461
461
  if (data.emails.indexOf(data.rawQuery) == -1) {
462
- data.emails = data.emails.concat([data.rawQuery]);
462
+ data.emails.push(data.rawQuery);
463
463
  }
464
464
  }
465
465
 
@@ -474,7 +474,7 @@ module.exports = function(mongoose, config) {
474
474
 
475
475
  if (pn.isValid()) {
476
476
  if (data.phones.indexOf(data.rawQuery) == -1) {
477
- data.phones = data.phones.concat([data.rawQuery]);
477
+ data.phones.push(data.rawQuery);
478
478
  }
479
479
  }
480
480
 
@@ -1068,11 +1068,11 @@ module.exports = function(mongoose, config) {
1068
1068
 
1069
1069
  switch(chairPos) {
1070
1070
  case 'first':
1071
- person.chairs.first = person.chairs.first.concat([chairObj]);
1071
+ person.chairs.first.push(chairObj);
1072
1072
  break;
1073
1073
 
1074
1074
  case 'second':
1075
- person.chairs.second = person.chairs.second.concat([chairObj]);
1075
+ person.chairs.second.push(chairObj);
1076
1076
  break;
1077
1077
  }
1078
1078
 
package/lib/Round.js CHANGED
@@ -315,7 +315,7 @@ module.exports = function(mongoose, config) {
315
315
  });
316
316
 
317
317
  // If not, add it
318
- if (!match) vehicle.investments = vehicle.investments.concat([investment]);
318
+ if (!match) vehicle.investments.push(investment);
319
319
  // note there is no need to compute vehicle cost as it is done during upsert
320
320
 
321
321
  };
@@ -342,7 +342,9 @@ module.exports = function(mongoose, config) {
342
342
  });
343
343
 
344
344
  // If not, add it
345
- if (!match) self.people = self.people.concat([{person: person}]);
345
+ if (!match) self.people.push({
346
+ person: person
347
+ });
346
348
 
347
349
  };
348
350
 
@@ -390,7 +392,7 @@ module.exports = function(mongoose, config) {
390
392
  realized: data.realized,
391
393
  valuationDate: data.valuationDate
392
394
  };
393
- self.vehicles = self.vehicles.concat([vehicle]);
395
+ self.vehicles.push(vehicle);
394
396
  }
395
397
 
396
398
  return vehicle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "7.42.0",
3
+ "version": "7.44.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",