Built motion from commit d127c62.|0.0.151
[motion.git] / server / models / int_freshdesk_configuration.js
index 33c48e8..9263ba8 100644 (file)
@@ -22,6 +22,19 @@ module.exports = function(sequelize, DataTypes) {
         as: 'Field',
         foreignKey: 'FieldId'
       });
+      models.FreshdeskConfiguration.belongsToMany(models.Tag, {
+        through: 'int_freshdesk_configuration_has_tags'
+      });
+      models.FreshdeskConfiguration.addScope('account', function(AccountId) {
+        return {
+          where: {
+            AccountId: AccountId
+          },
+          include: [{
+            all: true
+          }]
+        }
+      });
     }
   });
 };