pinia-orm-edge 1.9.2-28660070.3210918 → 1.9.2-28661520.9747a33
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 +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
@@ -668,7 +668,7 @@ class BelongsToMany extends Relation {
|
|
668
668
|
*/
|
669
669
|
match(relation, models, query) {
|
670
670
|
const relatedModels = query.get(false);
|
671
|
-
const pivotModels = query.newQuery(this.pivot.$
|
671
|
+
const pivotModels = query.newQuery(this.pivot.$modelEntity()).whereIn(this.relatedPivotKey, this.getKeys(relatedModels, this.relatedKey)).whereIn(this.foreignPivotKey, this.getKeys(models, this.parentKey)).groupBy(this.foreignPivotKey, this.relatedPivotKey).get();
|
672
672
|
models.forEach((parentModel) => {
|
673
673
|
const relationResults = [];
|
674
674
|
relatedModels.forEach((relatedModel) => {
|
@@ -2837,7 +2837,7 @@ class MorphToMany extends Relation {
|
|
2837
2837
|
*/
|
2838
2838
|
match(relation, models, query) {
|
2839
2839
|
const relatedModels = query.get(false);
|
2840
|
-
const pivotModels = query.newQuery(this.pivot.$
|
2840
|
+
const pivotModels = query.newQuery(this.pivot.$modelEntity()).whereIn(this.relatedId, this.getKeys(relatedModels, this.relatedKey)).whereIn(this.morphId, this.getKeys(models, this.parentKey)).groupBy(this.morphId, this.relatedId, this.morphType).get();
|
2841
2841
|
models.forEach((parentModel) => {
|
2842
2842
|
const relationResults = [];
|
2843
2843
|
relatedModels.forEach((relatedModel) => {
|
@@ -3032,7 +3032,7 @@ class Model {
|
|
3032
3032
|
const pivotInstance = pivot.newRawInstance();
|
3033
3033
|
parentKey = parentKey ?? model.$getLocalKey();
|
3034
3034
|
relatedKey = relatedKey ?? instance.$getLocalKey();
|
3035
|
-
this.schemas[related.
|
3035
|
+
this.schemas[related.modelEntity()][`pivot_${relatedPivotKey}_${pivotInstance.$entity()}`] = new HasOne(instance, pivotInstance, relatedPivotKey, relatedKey);
|
3036
3036
|
return new BelongsToMany(
|
3037
3037
|
model,
|
3038
3038
|
instance,
|
@@ -3052,7 +3052,7 @@ class Model {
|
|
3052
3052
|
const pivotInstance = pivot.newRawInstance();
|
3053
3053
|
parentKey = parentKey ?? model.$getLocalKey();
|
3054
3054
|
relatedKey = relatedKey ?? instance.$getLocalKey();
|
3055
|
-
this.schemas[related.
|
3055
|
+
this.schemas[related.modelEntity()][`pivot_${relatedId}_${pivotInstance.$entity()}`] = new MorphOne(instance, pivotInstance, relatedId, model.$entity(), relatedKey);
|
3056
3056
|
return new MorphToMany(
|
3057
3057
|
model,
|
3058
3058
|
instance,
|
package/dist/index.mjs
CHANGED
@@ -666,7 +666,7 @@ class BelongsToMany extends Relation {
|
|
666
666
|
*/
|
667
667
|
match(relation, models, query) {
|
668
668
|
const relatedModels = query.get(false);
|
669
|
-
const pivotModels = query.newQuery(this.pivot.$
|
669
|
+
const pivotModels = query.newQuery(this.pivot.$modelEntity()).whereIn(this.relatedPivotKey, this.getKeys(relatedModels, this.relatedKey)).whereIn(this.foreignPivotKey, this.getKeys(models, this.parentKey)).groupBy(this.foreignPivotKey, this.relatedPivotKey).get();
|
670
670
|
models.forEach((parentModel) => {
|
671
671
|
const relationResults = [];
|
672
672
|
relatedModels.forEach((relatedModel) => {
|
@@ -2835,7 +2835,7 @@ class MorphToMany extends Relation {
|
|
2835
2835
|
*/
|
2836
2836
|
match(relation, models, query) {
|
2837
2837
|
const relatedModels = query.get(false);
|
2838
|
-
const pivotModels = query.newQuery(this.pivot.$
|
2838
|
+
const pivotModels = query.newQuery(this.pivot.$modelEntity()).whereIn(this.relatedId, this.getKeys(relatedModels, this.relatedKey)).whereIn(this.morphId, this.getKeys(models, this.parentKey)).groupBy(this.morphId, this.relatedId, this.morphType).get();
|
2839
2839
|
models.forEach((parentModel) => {
|
2840
2840
|
const relationResults = [];
|
2841
2841
|
relatedModels.forEach((relatedModel) => {
|
@@ -3030,7 +3030,7 @@ class Model {
|
|
3030
3030
|
const pivotInstance = pivot.newRawInstance();
|
3031
3031
|
parentKey = parentKey ?? model.$getLocalKey();
|
3032
3032
|
relatedKey = relatedKey ?? instance.$getLocalKey();
|
3033
|
-
this.schemas[related.
|
3033
|
+
this.schemas[related.modelEntity()][`pivot_${relatedPivotKey}_${pivotInstance.$entity()}`] = new HasOne(instance, pivotInstance, relatedPivotKey, relatedKey);
|
3034
3034
|
return new BelongsToMany(
|
3035
3035
|
model,
|
3036
3036
|
instance,
|
@@ -3050,7 +3050,7 @@ class Model {
|
|
3050
3050
|
const pivotInstance = pivot.newRawInstance();
|
3051
3051
|
parentKey = parentKey ?? model.$getLocalKey();
|
3052
3052
|
relatedKey = relatedKey ?? instance.$getLocalKey();
|
3053
|
-
this.schemas[related.
|
3053
|
+
this.schemas[related.modelEntity()][`pivot_${relatedId}_${pivotInstance.$entity()}`] = new MorphOne(instance, pivotInstance, relatedId, model.$entity(), relatedKey);
|
3054
3054
|
return new MorphToMany(
|
3055
3055
|
model,
|
3056
3056
|
instance,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "pinia-orm-edge",
|
3
|
-
"version": "1.9.2-
|
3
|
+
"version": "1.9.2-28661520.9747a33",
|
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-
|
49
|
+
"@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.2-28661520.9747a33"
|
50
50
|
},
|
51
51
|
"devDependencies": {
|
52
52
|
"@nuxt/eslint-config": "^0.3.13",
|