You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -7157,7 +7163,7 @@ function _inject(definition, resource, attrs) {
7157
7163
varitem=DS.get(definition.name,id);
7158
7164
7159
7165
if(!item){
7160
-
if(definition.methods||definition.useClass){
7166
+
if(options.useClass){
7161
7167
if(attrsinstanceofdefinition[definition.class]){
7162
7168
item=attrs;
7163
7169
}else{
@@ -7279,6 +7285,7 @@ function _injectRelations(definition, injected, options) {
7279
7285
* @param {object|array} attrs The item or collection of items to inject into the data store.
7280
7286
* @param {object=} options The item or collection of items to inject into the data store. Properties:
7281
7287
*
7288
+
* - `{boolean=}` - `useClass` - Whether to wrap the injected item with the resource's instance constructor.
7282
7289
* - `{boolean=}` - `findBelongsTo` - Find and attach any existing "belongsTo" relationships to the newly injected item. Potentially expensive if enabled. Default: `false`.
7283
7290
* - `{boolean=}` - `findHasMany` - Find and attach any existing "hasMany" relationships to the newly injected item. Potentially expensive if enabled. Default: `false`.
7284
7291
* - `{boolean=}` - `findHasOne` - Find and attach any existing "hasOne" relationships to the newly injected item. Potentially expensive if enabled. Default: `false`.
@@ -7308,7 +7315,10 @@ function inject(resourceName, attrs, options) {
@@ -89,7 +89,7 @@ function _inject(definition, resource, attrs) {
89
89
varitem=DS.get(definition.name,id);
90
90
91
91
if(!item){
92
-
if(definition.methods||definition.useClass){
92
+
if(options.useClass){
93
93
if(attrsinstanceofdefinition[definition.class]){
94
94
item=attrs;
95
95
}else{
@@ -211,6 +211,7 @@ function _injectRelations(definition, injected, options) {
211
211
* @param {object|array} attrs The item or collection of items to inject into the data store.
212
212
* @param {object=} options The item or collection of items to inject into the data store. Properties:
213
213
*
214
+
* - `{boolean=}` - `useClass` - Whether to wrap the injected item with the resource's instance constructor.
214
215
* - `{boolean=}` - `findBelongsTo` - Find and attach any existing "belongsTo" relationships to the newly injected item. Potentially expensive if enabled. Default: `false`.
215
216
* - `{boolean=}` - `findHasMany` - Find and attach any existing "hasMany" relationships to the newly injected item. Potentially expensive if enabled. Default: `false`.
216
217
* - `{boolean=}` - `findHasOne` - Find and attach any existing "hasOne" relationships to the newly injected item. Potentially expensive if enabled. Default: `false`.
@@ -240,7 +241,10 @@ function inject(resourceName, attrs, options) {
0 commit comments