Skip to content

Commit 399c76f

Browse files
committed
improve test to also test that the result of currentModel is correct when used in mixin
1 parent a3a74bb commit 399c76f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/regression/test/issue-2536.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ describe('Regression for issue #2536', () => {
1717
users User[] @relation("UserGroups")
1818
}
1919
20-
model Foo {
21-
id String @id @default(cuid())
20+
// define a mixin to also check that currentModel correctly resolves to the model where the mixin is applied
21+
type AuthPolicyMixin {
2222
@@allow('all', auth().groups?[modelName == currentModel() && modelOperation == currentOperation()])
2323
}
24+
25+
model Foo with AuthPolicyMixin {
26+
id String @id @default(cuid())
27+
}
2428
`,
2529
);
2630

0 commit comments

Comments
 (0)