
/**
  @class

  @extends XT.Model
*/
XM.ProjectIncident = XT.Model.extend(
  /** @scope XM.ProjectIncident.prototype */ {

  recordType: 'XM.ProjectIncident',

  isDocumentAssignment: true,

  relations: [{
    type: Backbone.HasOne,
    key: 'incident',
    relatedModel: 'XM.IncidentInfo'
  }]

});

/**
  @class

  @extends XT.Model
*/
XM.ProjectOpportunity = XT.Model.extend(
  /** @scope XM.ProjectOpportunity.prototype */ {

  recordType: 'XM.ProjectOpportunity',

  isDocumentAssignment: true,

  relations: [{
    type: Backbone.HasOne,
    key: 'opportunity',
    relatedModel: 'XM.OpportunityInfo'
  }]

});

/**
  @class

  @extends XT.Model
*/
XM.ProjectToDo = XT.Model.extend(
  /** @scope XM.ProjectToDo.prototype */ {

  recordType: 'XM.ProjectToDo',

  isDocumentAssignment: true,

  relations: [{
    type: Backbone.HasOne,
    key: 'toDo',
    relatedModel: 'XM.ToDoInfo'
  }]

});



XM.Project.prototype.relations.push(
  {
    type: Backbone.HasMany,
    key: 'incidents',
    relatedModel: 'XM.ProjectIncident',
    reverseRelation: {
      key: 'project'
    }
  },
  {
    type: Backbone.HasMany,
    key: 'opportunities',
    relatedModel: 'XM.ProjectOpportunity',
    reverseRelation: {
      key: 'project'
    }
  },
  {
    type: Backbone.HasMany,
    key: 'toDos',
    relatedModel: 'XM.ProjectToDo',
    reverseRelation: {
      key: 'project'
    }
  }
);

XM.ToDo.prototype.relations.push(
  {
    type: Backbone.HasOne,
    key: 'incident',
    relatedModel: 'XM.IncidentInfo'
  }
);

XM.Incident.prototype.relations.push(
  {
    type: Backbone.HasMany,
    key: 'toDos',
    relatedModel: 'XM.ToDo',
    reverseRelation: {
      key: 'incident'
    }
  }
);


@@ -1,29 +1,293 @@
-%0A/**%0A
+/*jshint indent:2, curly:true eqeqeq:true, immed:true, latedef:true, %0Anewcap:true, noarg:true, regexp:true, undef:true, strict:true, trailing:true%0Awhite:true*/%0A/*global XT:true, XM:true, Backbone:true, _:true, console:true */%0A%0A(function () %7B%0A  %22use strict%22;%0A  %0A  /**%0A  
   @class%0A%0A  @extends XT.
@@ -264,32 +264,34 @@
 /**%0A    @class%0A%0A
+  
   @extends XT.Mo
@@ -286,35 +286,39 @@
 xtends XT.Model%0A
+  
 */%0A
+  
 XM.ProjectIncide
@@ -331,32 +331,34 @@
 T.Model.extend(%0A
+  
   /** @scope XM.
@@ -381,32 +381,34 @@
 prototype */ %7B%0A%0A
+  
   recordType: 'X
@@ -426,24 +426,26 @@
 cident',%0A%0A  
+ 
+ 
 isDocumentAs
@@ -462,126 +462,27 @@
 true
-,%0A
 %0A  
-relations: %5B%7B%0A    type: Backbone.HasOne,%0A    key: 'incident',%0A    relatedModel: 'XM.IncidentInfo'%0A  %7D%5D%0A%0A
+%0A  
 %7D);%0A%0A
+  
 /**%0A
+  
   @c
@@ -479,32 +479,34 @@
 /**%0A    @class%0A%0A
+  
   @extends XT.Mo
@@ -501,35 +501,39 @@
 xtends XT.Model%0A
+  
 */%0A
+  
 XM.ProjectOpport
@@ -549,32 +549,34 @@
 T.Model.extend(%0A
+  
   /** @scope XM.
@@ -602,32 +602,34 @@
 prototype */ %7B%0A%0A
+  
   recordType: 'X
@@ -648,24 +648,26 @@
 ortunity',%0A%0A
+  
   isDocument
@@ -686,132 +686,27 @@
 true
-,%0A
 %0A  
-relations: %5B%7B%0A    type: Backbone.HasOne,%0A    key: 'opportunity',%0A    relatedModel: 'XM.OpportunityInfo'%0A  %7D%5D%0A%0A
+%0A  
 %7D);%0A%0A
+  
 /**%0A
+  
   @c
@@ -711,16 +711,18 @@
 @class%0A%0A
+  
   @exten
@@ -733,19 +733,23 @@
 T.Model%0A
+  
 */%0A
+  
 XM.Proje
@@ -774,16 +774,18 @@
 extend(%0A
+  
   /** @s
@@ -822,16 +822,18 @@
 */ %7B%0A%0A  
+ 
+ 
 recordTy
@@ -855,16 +855,18 @@
 ToDo',%0A%0A
+  
   isDocu
@@ -889,904 +889,19 @@
 true
-,
 %0A%0A  
-relations: %5B%7B%0A    type: Backbone.HasOne,%0A    key: 'toDo',%0A    relatedModel: 'XM.ToDoInfo'%0A  %7D%5D%0A%0A%7D);%0A%0A%0A%0AXM.Project.prototype.relations.push(%0A  %7B%0A    type: Backbone.HasMany,%0A    key: 'incidents',%0A    relatedModel: 'XM.ProjectIncident',%0A    reverseRelation: %7B%0A      key: 'project'%0A    %7D%0A  %7D,%0A  %7B%0A    type: Backbone.HasMany,%0A    key: 'opportunities',%0A    relatedModel: 'XM.ProjectOpportunity',%0A    reverseRelation: %7B%0A      key: 'project'%0A    %7D%0A  %7D,%0A  %7B%0A    type: Backbone.HasMany,%0A    key: 'toDos',%0A    relatedModel: 'XM.ProjectToDo',%0A    reverseRelation: %7B%0A      key: 'project'%0A    %7D%0A  %7D%0A);%0A%0AXM.ToDo.prototype.relations.push(%0A  %7B%0A    type: Backbone.HasOne,%0A    key: 'incident',%0A    relatedModel: 'XM.IncidentInfo'%0A  %7D%0A);%0A%0AXM.Incident.prototype.relations.push(%0A  %7B%0A    type: Backbone.HasMany,%0A    key: 'toDos',%0A    relatedModel: 'XM.ToDo',%0A    reverseRelation: %7B%0A      key: 'incident'%0A    %7D%0A  %7D%0A
+%7D);%0A%0A%7D()
 );%0A
-%0A

Remove un-needed relations.