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

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.
@@ -232,11 +232,11 @@ class MikroOrmDriver extends BaseDriver
232
232
  async appendRelationsToCollection(entitiesCollection, relations)
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
- if(typeof this.rawModel.entity.relationsMappings !== 'function'){
235
+ if(typeof this.rawModel.entity.relationMappings !== 'function'){
236
236
  return entitiesCollection;
237
237
  }
238
238
  if(!sc.isArray(relations) || 0 === relations.length){
239
- relations = Object.keys(this.rawModel.entity.relationsMappings() || {});
239
+ relations = Object.keys(this.rawModel.entity.relationMappings() || {});
240
240
  }
241
241
  if(0 === relations.length){
242
242
  return entitiesCollection;
@@ -250,12 +250,12 @@ class MikroOrmDriver extends BaseDriver
250
250
  async appendRelatedEntities(entity, relations)
251
251
  {
252
252
  // @TODO - BETA - Refactor and improve.
253
- if(typeof this.rawModel.entity.relationsMappings !== 'function'){
253
+ if(typeof this.rawModel.entity.relationMappings !== 'function'){
254
254
  return entity;
255
255
  }
256
- let relationsMappings = this.rawModel.entity.relationsMappings();
256
+ let relationMappings = this.rawModel.entity.relationMappings();
257
257
  for(let i of relations){
258
- let relation = relationsMappings[i];
258
+ let relation = relationMappings[i];
259
259
  let relationRepository = this.server.getEntity(relation.entityName);
260
260
  let isManyToOne = 'm:1' === relation.reference;
261
261
  let isOneToMany = '1:m' === relation.reference;
@@ -271,13 +271,13 @@ class MikroOrmDriver extends BaseDriver
271
271
 
272
272
  async createNested(newInstance, params)
273
273
  {
274
- if(typeof this.rawModel.entity.relationsMappings !== 'function'){
274
+ if(typeof this.rawModel.entity.relationMappings !== 'function'){
275
275
  return false;
276
276
  }
277
- let relationsMappings = this.rawModel.entity.relationsMappings();
278
- for(let i of Object.keys(relationsMappings)){
277
+ let relationMappings = this.rawModel.entity.relationMappings();
278
+ for(let i of Object.keys(relationMappings)){
279
279
  // @TODO - BETA - Refactor and improve.
280
- let relationData = relationsMappings[i];
280
+ let relationData = relationMappings[i];
281
281
  let relationEntity = this.server.entityManager.get(relationData.entityName).rawModel.entity;
282
282
  if(!relationEntity){
283
283
  Logger.warning('Factory not found for relation definition:', relationData);
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.37",
4
+ "version": "0.10.0-beta.38",
5
5
  "description": "Reldens - Storage",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",