Built motion from commit 1038d87.|0.0.141
[motion.git] / server / models / tools_interval.js
index 19ca5d7..8addfa8 100644 (file)
@@ -1,4 +1,6 @@
-/* jshint indent: 2 */
+'use strict';
+
+
 
 module.exports = function(sequelize, DataTypes) {
   var Interval = sequelize.define('Interval', {
@@ -27,16 +29,19 @@ module.exports = function(sequelize, DataTypes) {
       Interval.hasMany(models.MailApplication, {
         as: 'MailApplications'
       });
-      Interval.hasMany(models.MailApplication, {
+      Interval.hasMany(models.ChatApplication, {
         as: 'ChatApplications'
       });
+      Interval.hasMany(models.FaxApplication, {
+        as: 'FaxApplications'
+      });
       // SCOPES MANAGEMENT
       Interval.addScope('subintervals', {
         include: [{
           model: models.Interval,
           as: 'SubIntervals',
           required: false,
-          attributes: ['name', 'interval']
+          attributes: ['name', 'interval', 'id']
         }]
       });
 
@@ -48,6 +53,5 @@ module.exports = function(sequelize, DataTypes) {
     }
   });
 
-
   return Interval;
 };