File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
packages/schema/src/language-server Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ export class ZModelScopeProvider extends DefaultScopeProvider {
204
204
private createScopeForContainingModel ( node : AstNode , globalScope : Scope ) {
205
205
const model = getContainerOfType ( node , isDataModel ) ;
206
206
if ( model ) {
207
- return this . createScopeForNodes ( model . fields , globalScope ) ;
207
+ return this . createScopeForModel ( model , globalScope ) ;
208
208
} else {
209
209
return EMPTY_SCOPE ;
210
210
}
Original file line number Diff line number Diff line change
1
+ import { loadModel } from '@zenstackhq/testtools' ;
2
+
3
+ describe ( 'issue 1695' , ( ) => {
4
+ it ( 'regression' , async ( ) => {
5
+ await loadModel (
6
+ `
7
+ abstract model SoftDelete {
8
+ deleted Int @default(0) @omit
9
+ }
10
+
11
+ model MyModel extends SoftDelete {
12
+ id String @id @default(cuid())
13
+ name String
14
+
15
+ @@deny('update', deleted != 0 && future().deleted != 0)
16
+ @@deny('read', this.deleted != 0)
17
+ }
18
+ `
19
+ ) ;
20
+ } ) ;
21
+ } ) ;
You can’t perform that action at this time.
0 commit comments