@@ -5537,7 +5537,7 @@ function _inject(definition, resource, attrs) {
5537
5537
return injected ;
5538
5538
}
5539
5539
5540
- function _injectRelations ( definition , injected , options , injectedSoFar ) {
5540
+ function _injectRelations ( definition , injected , options ) {
5541
5541
var DS = this ;
5542
5542
DS . utils . forOwn ( definition . relations , function ( relatedModels , type ) {
5543
5543
DS . utils . forOwn ( relatedModels , function ( defs , relationName ) {
@@ -5546,10 +5546,10 @@ function _injectRelations(definition, injected, options, injectedSoFar) {
5546
5546
}
5547
5547
5548
5548
function _process ( def , injected ) {
5549
- if ( DS . definitions [ relationName ] && injected [ def . localField ] && ! injectedSoFar [ relationName + injected [ def . localField ] [ DS . definitions [ relationName ] . idAttribute ] ] ) {
5549
+ if ( DS . definitions [ relationName ] && injected [ def . localField ] && ! data . injectedSoFar [ relationName + injected [ def . localField ] [ DS . definitions [ relationName ] . idAttribute ] ] ) {
5550
5550
try {
5551
- injectedSoFar [ relationName + injected [ def . localField ] [ DS . definitions [ relationName ] . idAttribute ] ] = 1 ;
5552
- injected [ def . localField ] = DS . inject ( relationName , injected [ def . localField ] , options , injectedSoFar ) ;
5551
+ data . injectedSoFar [ relationName + injected [ def . localField ] [ DS . definitions [ relationName ] . idAttribute ] ] = 1 ;
5552
+ injected [ def . localField ] = DS . inject ( relationName , injected [ def . localField ] , options ) ;
5553
5553
} catch ( err ) {
5554
5554
DS . $log . error ( errorPrefix ( definition . name ) + 'Failed to inject ' + type + ' relation: "' + relationName + '"!' , err ) ;
5555
5555
}
@@ -5637,7 +5637,7 @@ function _injectRelations(definition, injected, options, injectedSoFar) {
5637
5637
* @returns {object|array } A reference to the item that was injected into the data store or an array of references to
5638
5638
* the items that were injected into the data store.
5639
5639
*/
5640
- function inject ( resourceName , attrs , options , injectedSoFar ) {
5640
+ function inject ( resourceName , attrs , options ) {
5641
5641
var DS = this ;
5642
5642
var IA = DS . errors . IA ;
5643
5643
var definition = DS . definitions [ resourceName ] ;
@@ -5663,13 +5663,13 @@ function inject(resourceName, attrs, options, injectedSoFar) {
5663
5663
try {
5664
5664
if ( ! DS . $rootScope . $$phase ) {
5665
5665
DS . $rootScope . $apply ( function ( ) {
5666
- injected = _inject . call ( DS , definition , resource , attrs , injectedSoFar || data . injectedSoFar ) ;
5666
+ injected = _inject . call ( DS , definition , resource , attrs ) ;
5667
5667
} ) ;
5668
5668
} else {
5669
- injected = _inject . call ( DS , definition , resource , attrs , injectedSoFar || data . injectedSoFar ) ;
5669
+ injected = _inject . call ( DS , definition , resource , attrs ) ;
5670
5670
}
5671
5671
if ( definition . relations ) {
5672
- _injectRelations . call ( DS , definition , injected , options , injectedSoFar || data . injectedSoFar ) ;
5672
+ _injectRelations . call ( DS , definition , injected , options ) ;
5673
5673
}
5674
5674
5675
5675
DS . notify ( definition , 'inject' , injected ) ;
0 commit comments