@nocobase/database 0.20.0-alpha.5 → 0.20.0-alpha.6

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.
@@ -278,11 +278,15 @@ const _EagerLoadingTree = class _EagerLoadingTree {
278
278
  }
279
279
  if (associationType == "BelongsToMany") {
280
280
  const foreignKeyValues = node.parent.instances.map((instance) => instance.get(association.sourceKey));
281
- const pivotAssoc = new import_sequelize.HasOne(association.target, association.through.model, {
281
+ const hasOneOptions = {
282
282
  as: "_pivot_",
283
283
  foreignKey: association.otherKey,
284
284
  sourceKey: association.targetKey
285
- });
285
+ };
286
+ if (association.through.scope) {
287
+ hasOneOptions.scope = association.through.scope;
288
+ }
289
+ const pivotAssoc = new import_sequelize.HasOne(association.target, association.through.model, hasOneOptions);
286
290
  instances = await node.model.findAll({
287
291
  transaction,
288
292
  attributes: node.attributes,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "0.20.0-alpha.5",
3
+ "version": "0.20.0-alpha.6",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "license": "Apache-2.0",
8
8
  "dependencies": {
9
- "@nocobase/logger": "0.20.0-alpha.5",
10
- "@nocobase/utils": "0.20.0-alpha.5",
9
+ "@nocobase/logger": "0.20.0-alpha.6",
10
+ "@nocobase/utils": "0.20.0-alpha.6",
11
11
  "async-mutex": "^0.3.2",
12
12
  "chalk": "^4.1.1",
13
13
  "cron-parser": "4.4.0",
@@ -35,5 +35,5 @@
35
35
  "url": "git+https://github.com/nocobase/nocobase.git",
36
36
  "directory": "packages/database"
37
37
  },
38
- "gitHead": "b72d7fdf357a6bc4460ff181644b9014d3dad13b"
38
+ "gitHead": "281767b02ce11f9172fb72e5e53ff98bc80b6eaf"
39
39
  }