Skip to content

Commit

Permalink
Merge pull request #97 from Carifio24/fix-alldata-bug
Browse files Browse the repository at this point in the history
Fix issue with students in multiple classes
  • Loading branch information
Carifio24 authored Nov 8, 2023
2 parents 485d21e + 5c0fd78 commit cce1794
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stories/hubbles_law/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ export async function getAllHubbleMeasurements(before: Date | null = null): Prom
whereConditions.push({ last_modified: { [Op.lt]: before } });
}
return HubbleMeasurement.findAll({
raw: true,
attributes: {
// The "student" here comes from the alias below
// We do this so that we get access to the included field as just "class_id"
Expand All @@ -397,11 +398,11 @@ export async function getAllHubbleMeasurements(before: Date | null = null): Prom
include: [{
model: Galaxy,
as: "galaxy",
attributes: ["id", "type"]
attributes: []
}, {
model: Student,
as: "student",
attributes: ["seed", "dummy"],
attributes: [],
where: {
[Op.or]: [
{ seed: 1 }, { dummy: 0 }
Expand Down

0 comments on commit cce1794

Please sign in to comment.