File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,11 @@ async fn delete_all_from_many(conn: ConnectionAsync) {
164164
165165 post. tags . delete ( & conn) . await . unwrap ( ) ;
166166
167+ // Verify that the tags are deleted from the Many object
168+ let tags: Vec < & Tag > = post. tags . get ( ) . unwrap ( ) . collect ( ) ;
169+ assert_eq ! ( tags. len( ) , 0 ) ;
170+
171+ // Verify that the tags are deleted from the database
167172 let post2 = Post :: get ( & conn, post. id ) . await . unwrap ( ) ;
168173 assert_eq ! ( post2. tags. load( & conn) . await . unwrap( ) . count( ) , 0 ) ;
169174}
Original file line number Diff line number Diff line change @@ -269,8 +269,8 @@ impl<T: DataObject> ManyOps<T> for Many<T> {
269269 . await ?;
270270 self . new_values . clear ( ) ;
271271 self . removed_values . clear ( ) ;
272- // all_values is now out of date, so clear it
273- self . all_values = OnceLock :: new ( ) ;
272+ // all_values is now out of date, so empty it
273+ self . all_values = OnceLock :: from ( Vec :: new ( ) ) ;
274274 Ok ( ( ) )
275275 }
276276
You can’t perform that action at this time.
0 commit comments