File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ private struct PlayerWithRequiredTeam: FetchableRecord {
2222
2323 init ( row: Row ) throws {
2424 player = try Player ( row: row)
25- team = row [ Player . teamScope]
25+ let subscriptTeam : Team = row [ Player . teamScope]
26+ let decodedTeam : Team = try row. decode ( forKey: Player . teamScope)
27+ XCTAssertEqual ( subscriptTeam. id, decodedTeam. id)
28+ team = subscriptTeam
2629 }
2730}
2831
@@ -32,7 +35,10 @@ private struct PlayerWithOptionalTeam: FetchableRecord {
3235
3336 init ( row: Row ) throws {
3437 player = try Player ( row: row)
35- team = row [ Player . teamScope]
38+ let subscriptTeam : Team ? = row [ Player . teamScope]
39+ let decodedTeam : Team ? = try row. decodeIfPresent ( forKey: Player . teamScope)
40+ XCTAssertEqual ( subscriptTeam? . id, decodedTeam? . id)
41+ team = subscriptTeam
3642 }
3743}
3844
You can’t perform that action at this time.
0 commit comments