pinia-orm-edge 1.9.2-28598847.4872cc7 → 1.9.2-28609152.ed747cb

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.
package/dist/index.cjs CHANGED
@@ -649,7 +649,7 @@ class BelongsToMany extends Relation {
649
649
  const pivot = child.pivot ?? {};
650
650
  pivot[this.foreignPivotKey] = record[this.parentKey];
651
651
  pivot[this.relatedPivotKey] = child[this.relatedKey];
652
- child[`pivot_${this.pivot.$entity()}`] = pivot;
652
+ child[`pivot_${this.relatedPivotKey}_${this.pivot.$entity()}`] = pivot;
653
653
  }
654
654
  /**
655
655
  * Convert given value to the appropriate value for the attribute.
@@ -2818,7 +2818,7 @@ class MorphToMany extends Relation {
2818
2818
  pivot[this.morphId] = record[this.parentKey];
2819
2819
  pivot[this.morphType] = this.parent.$entity();
2820
2820
  pivot[this.relatedId] = child[this.relatedKey];
2821
- child[`pivot_${this.pivot.$entity()}`] = pivot;
2821
+ child[`pivot_${this.relatedId}_${this.pivot.$entity()}`] = pivot;
2822
2822
  }
2823
2823
  /**
2824
2824
  * Convert given value to the appropriate value for the attribute.
@@ -3026,7 +3026,7 @@ class Model {
3026
3026
  const pivotInstance = pivot.newRawInstance();
3027
3027
  parentKey = parentKey ?? model.$getLocalKey();
3028
3028
  relatedKey = relatedKey ?? instance.$getLocalKey();
3029
- this.schemas[related.entity][`pivot_${pivotInstance.$entity()}`] = new HasOne(instance, pivotInstance, relatedPivotKey, relatedKey);
3029
+ this.schemas[related.entity][`pivot_${relatedPivotKey}_${pivotInstance.$entity()}`] = new HasOne(instance, pivotInstance, relatedPivotKey, relatedKey);
3030
3030
  return new BelongsToMany(
3031
3031
  model,
3032
3032
  instance,
@@ -3046,7 +3046,7 @@ class Model {
3046
3046
  const pivotInstance = pivot.newRawInstance();
3047
3047
  parentKey = parentKey ?? model.$getLocalKey();
3048
3048
  relatedKey = relatedKey ?? instance.$getLocalKey();
3049
- this.schemas[related.entity][`pivot_${pivotInstance.$entity()}`] = new MorphOne(instance, pivotInstance, relatedId, model.$entity(), relatedKey);
3049
+ this.schemas[related.entity][`pivot_${relatedId}_${pivotInstance.$entity()}`] = new MorphOne(instance, pivotInstance, relatedId, model.$entity(), relatedKey);
3050
3050
  return new MorphToMany(
3051
3051
  model,
3052
3052
  instance,
package/dist/index.mjs CHANGED
@@ -647,7 +647,7 @@ class BelongsToMany extends Relation {
647
647
  const pivot = child.pivot ?? {};
648
648
  pivot[this.foreignPivotKey] = record[this.parentKey];
649
649
  pivot[this.relatedPivotKey] = child[this.relatedKey];
650
- child[`pivot_${this.pivot.$entity()}`] = pivot;
650
+ child[`pivot_${this.relatedPivotKey}_${this.pivot.$entity()}`] = pivot;
651
651
  }
652
652
  /**
653
653
  * Convert given value to the appropriate value for the attribute.
@@ -2816,7 +2816,7 @@ class MorphToMany extends Relation {
2816
2816
  pivot[this.morphId] = record[this.parentKey];
2817
2817
  pivot[this.morphType] = this.parent.$entity();
2818
2818
  pivot[this.relatedId] = child[this.relatedKey];
2819
- child[`pivot_${this.pivot.$entity()}`] = pivot;
2819
+ child[`pivot_${this.relatedId}_${this.pivot.$entity()}`] = pivot;
2820
2820
  }
2821
2821
  /**
2822
2822
  * Convert given value to the appropriate value for the attribute.
@@ -3024,7 +3024,7 @@ class Model {
3024
3024
  const pivotInstance = pivot.newRawInstance();
3025
3025
  parentKey = parentKey ?? model.$getLocalKey();
3026
3026
  relatedKey = relatedKey ?? instance.$getLocalKey();
3027
- this.schemas[related.entity][`pivot_${pivotInstance.$entity()}`] = new HasOne(instance, pivotInstance, relatedPivotKey, relatedKey);
3027
+ this.schemas[related.entity][`pivot_${relatedPivotKey}_${pivotInstance.$entity()}`] = new HasOne(instance, pivotInstance, relatedPivotKey, relatedKey);
3028
3028
  return new BelongsToMany(
3029
3029
  model,
3030
3030
  instance,
@@ -3044,7 +3044,7 @@ class Model {
3044
3044
  const pivotInstance = pivot.newRawInstance();
3045
3045
  parentKey = parentKey ?? model.$getLocalKey();
3046
3046
  relatedKey = relatedKey ?? instance.$getLocalKey();
3047
- this.schemas[related.entity][`pivot_${pivotInstance.$entity()}`] = new MorphOne(instance, pivotInstance, relatedId, model.$entity(), relatedKey);
3047
+ this.schemas[related.entity][`pivot_${relatedId}_${pivotInstance.$entity()}`] = new MorphOne(instance, pivotInstance, relatedId, model.$entity(), relatedKey);
3048
3048
  return new MorphToMany(
3049
3049
  model,
3050
3050
  instance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinia-orm-edge",
3
- "version": "1.9.2-28598847.4872cc7",
3
+ "version": "1.9.2-28609152.ed747cb",
4
4
  "description": "The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.",
5
5
  "keywords": [
6
6
  "vue",
@@ -46,7 +46,7 @@
46
46
  "pinia": "^2.1.7"
47
47
  },
48
48
  "dependencies": {
49
- "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.2-28598847.4872cc7"
49
+ "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.2-28609152.ed747cb"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@nuxt/eslint-config": "^0.3.12",