@dhyasama/totem-models 6.4.1 → 6.5.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
@@ -56,14 +56,6 @@ module.exports = function(mongoose, config) {
56
56
  description: { type: String, trim: true, required: true }
57
57
  }],
58
58
 
59
- votes: [{
60
- timestamp: { type: Date, required: true, default: Date.now },
61
- person: { type: Schema.ObjectId, ref: 'Person', required: true },
62
- value: { type: Number }
63
- }],
64
-
65
- sectors: [{ type: String, trim: true }],
66
-
67
59
  customFields: { type: Schema.Types.Mixed }
68
60
 
69
61
  });
@@ -106,21 +98,6 @@ module.exports = function(mongoose, config) {
106
98
 
107
99
  });
108
100
 
109
- Deal.virtual('voteValue').get(function () {
110
-
111
- var self = this;
112
-
113
- if(!self.votes || self.votes.length == 0) return null;
114
-
115
- var voteValue = 0;
116
- _.each(self.votes, function(vote) {
117
- voteValue += vote.value;
118
- });
119
-
120
- return voteValue;
121
-
122
- });
123
-
124
101
  ///////////////////////////////////////////////////////////////////////////////////////
125
102
  // METHODS
126
103
  // Methods operate on a single document that has already been returned
@@ -198,7 +175,6 @@ module.exports = function(mongoose, config) {
198
175
  .populate('messages')
199
176
  .populate('sources.person', 'name avatarUrl title')
200
177
  .populate('referrers.person', 'name avatarUrl title')
201
- .populate('votes.person', 'name avatarUrl title')
202
178
  .populate({
203
179
  path: 'documents',
204
180
  match: { customer: customerId }
@@ -350,6 +326,9 @@ module.exports = function(mongoose, config) {
350
326
 
351
327
  }
352
328
 
329
+ // Required for mixed types
330
+ deal.markModified('customFields');
331
+
353
332
  deal.save(cb);
354
333
 
355
334
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "6.4.1",
3
+ "version": "6.5.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
package/.npmignore DELETED
@@ -1,14 +0,0 @@
1
- lib-cov
2
- *.seed
3
- *.log
4
- *.csv
5
- *.dat
6
- *.out
7
- *.pid
8
- *.gz
9
-
10
- npm-debug.log
11
- node_modules
12
-
13
- .DS_Store
14
- .idea