Fix broken type detection in database setup

This commit is contained in:
Bob Farrell 2024-11-12 08:21:51 +00:00
parent a6d1b92f5e
commit e4da5bc9c8

View File

@ -33,7 +33,7 @@ pub fn repo(allocator: std.mem.Allocator, app: anytype) !Repo {
.testing => false,
},
// Checking field presence here makes setting up test App a bit simpler.
.env = if (@hasField(@TypeOf(app), "env")) try repoEnv(app.env) else .{},
.env = if (@TypeOf(app) == *const jetzig.App) try repoEnv(app.env) else .{},
},
);
}