@reldens/storage 0.10.0-beta.36 → 0.10.0-beta.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -162,7 +162,7 @@ class BaseDriver
162
162
  Logger.error('Custom query method not found in raw model.', methodName, this.rawModel);
163
163
  return false;
164
164
  }
165
- return this.rawModel[methodName](methodOptions);
165
+ return this.rawModel[methodName](methodOptions, this);
166
166
  }
167
167
 
168
168
  }
@@ -132,7 +132,7 @@ class MikroOrmDriver extends BaseDriver
132
132
 
133
133
  async loadAllWithRelations(relations)
134
134
  {
135
- let entities = await this.repository.find(filter, this.queryBuilder(true, true, true));
135
+ let entities = await this.loadAll();
136
136
  return await this.appendRelationsToCollection(entities, relations);
137
137
  }
138
138
 
@@ -233,7 +233,7 @@ class MikroOrmDriver extends BaseDriver
233
233
  {
234
234
  // @TODO - BETA - Refactor. I would like to use populate but it may not work if the driver is not Mongo DB.
235
235
  if(typeof this.rawModel.entity.relationsMappings !== 'function'){
236
- return false;
236
+ return entitiesCollection;
237
237
  }
238
238
  if(!sc.isArray(relations) || 0 === relations.length){
239
239
  relations = Object.keys(this.rawModel.entity.relationsMappings() || {});
@@ -251,7 +251,7 @@ class MikroOrmDriver extends BaseDriver
251
251
  {
252
252
  // @TODO - BETA - Refactor and improve.
253
253
  if(typeof this.rawModel.entity.relationsMappings !== 'function'){
254
- return false;
254
+ return entity;
255
255
  }
256
256
  let relationsMappings = this.rawModel.entity.relationsMappings();
257
257
  for(let i of relations){
@@ -266,6 +266,7 @@ class MikroOrmDriver extends BaseDriver
266
266
  entity[i] = await relationRepository.loadBy(relation.join.to, entity[relation.join.from]);
267
267
  }
268
268
  }
269
+ return entity;
269
270
  }
270
271
 
271
272
  async createNested(newInstance, params)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reldens/storage",
3
3
  "scope": "@reldens",
4
- "version": "0.10.0-beta.36",
4
+ "version": "0.10.0-beta.37",
5
5
  "description": "Reldens - Storage",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",