@dhyasama/totem-models 6.16.3 → 6.17.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/.npmignore ADDED
@@ -0,0 +1,14 @@
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
@@ -1278,6 +1278,23 @@ module.exports = function(mongoose, config) {
1278
1278
  this.find({ 'slug': { $in : slugs } }).exec(cb);
1279
1279
  };
1280
1280
 
1281
+ Organization.statics.findBySocial = function findBySocial(handle, cb) {
1282
+
1283
+ var self = this;
1284
+
1285
+ self
1286
+ .find({ $or:
1287
+ [
1288
+ { 'social.facebook': handle },
1289
+ { 'social.linkedin': handle },
1290
+ { 'social.twitter': handle }
1291
+ ],
1292
+ 'deleted': { $ne: true }
1293
+ })
1294
+ .exec(cb);
1295
+
1296
+ };
1297
+
1281
1298
  Organization.statics.findDupes = function findDupes(org, options, cb) {
1282
1299
 
1283
1300
  if (!cb) throw new Error('cb is required');