File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export default function Model(
82
82
/**
83
83
* Determine if the instance has been trashed.
84
84
*/
85
- model . prototype . trashed = function ( ) {
85
+ model . prototype . $ trashed = function ( ) {
86
86
const { flagName } = context . createConfig ( this . $self ( ) . softDeleteConfig )
87
87
88
88
return this [ flagName ] === true
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export default function Query(
93
93
}
94
94
95
95
/**
96
- * Fetch all trashed records from the store
96
+ * Fetch all trashed records from the store.
97
97
*/
98
98
query . prototype . allTrashed = function ( ) {
99
99
return this . onlyTrashed ( ) . get ( )
@@ -121,18 +121,18 @@ export default function Query(
121
121
models : Data . Collection
122
122
) {
123
123
return models . filter ( ( model ) => {
124
- // Only trashed records.
124
+ // Only trashed records
125
125
if ( this . softDeletesFilter === true ) {
126
- return model . trashed ( )
126
+ return model . $ trashed( )
127
127
}
128
128
129
- // Include trashed records.
129
+ // Include trashed records
130
130
if ( this . softDeletesFilter === false ) {
131
131
return models
132
132
}
133
133
134
- // Exclude trashed records.
135
- return ! model . trashed ( )
134
+ // Exclude trashed records
135
+ return ! model . $ trashed( )
136
136
} )
137
137
} )
138
138
}
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ declare module '@vuex-orm/core' {
43
43
/**
44
44
* Determine if the instance has been trashed.
45
45
*/
46
- trashed ( ) : boolean
46
+ $ trashed( ) : boolean
47
47
}
48
48
49
49
namespace Query {
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ describe('Feature - Model - Retrieve', () => {
81
81
await User . softDelete ( 1 )
82
82
83
83
const users = User . query ( )
84
- . where ( ( user : User ) => user . trashed ( ) )
84
+ . where ( ( user : User ) => user . $ trashed( ) )
85
85
. get ( )
86
86
87
87
expect ( users . length ) . toBe ( 0 )
@@ -116,7 +116,7 @@ describe('Feature - Model - Retrieve', () => {
116
116
. get ( )
117
117
118
118
expect ( users . length ) . toBe ( 2 )
119
- expect ( users [ 0 ] . trashed ( ) ) . toBe ( true )
120
- expect ( users [ 1 ] . trashed ( ) ) . toBe ( false )
119
+ expect ( users [ 0 ] . $ trashed( ) ) . toBe ( true )
120
+ expect ( users [ 1 ] . $ trashed( ) ) . toBe ( false )
121
121
} )
122
122
} )
You can’t perform that action at this time.
0 commit comments