@dhyasama/totem-models 7.0.1 → 7.0.2

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/Financials.js CHANGED
@@ -175,10 +175,16 @@ module.exports = function(mongoose, config) {
175
175
  ///////////////////////////////////////////////////////////////////////////////////////
176
176
 
177
177
  Financials.virtual('snapshotNames').get(function () {
178
- return _.map(this.snapshots, function(snapshot) {
179
- if (snapshot.year) { return snapshot.year.toString() + ' ' + snapshot.period; }
180
- else { return snapshot.period; }
178
+
179
+ var names = _.map(this.snapshots, function(snapshot) {
180
+ if (snapshot.year && snapshot.period) { return snapshot.year.toString() + ' ' + snapshot.period; }
181
+ else if (snapshot.year) { return snapshot.year; }
182
+ else if (snapshot.period) { return snapshot.period; }
183
+ else { return null; }
181
184
  });
185
+
186
+ return _.compact(names);
187
+
182
188
  });
183
189
 
184
190
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",