Skip to content

fix: Subject Listフィルタの子テーブル条件を単一サブクエリに統合#26

Merged
masaya-osuga merged 1 commit intomainfrom
fix/subject-list-filter-bug
Apr 1, 2026
Merged

fix: Subject Listフィルタの子テーブル条件を単一サブクエリに統合#26
masaya-osuga merged 1 commit intomainfrom
fix/subject-list-filter-bug

Conversation

@masaya-osuga
Copy link
Copy Markdown
Member

@masaya-osuga masaya-osuga commented Apr 1, 2026

Summary

  • SubjectEligibleAttribute(Grade, Class)と SubjectRequirement(Courses, RequirementType)のフィルタが、同一テーブルに対して別々のサブクエリを発行していたバグを修正
  • 同一テーブルへの条件を単一サブクエリに統合し、両方指定時にAND条件として正しく機能するように修正

Test plan

  • Grade + Class を同時に指定して、両条件を満たす科目のみが返ることを確認
  • Courses + RequirementType を同時に指定して、両条件を満たす科目のみが返ることを確認
  • 各フィルタを単独で指定した場合の動作が変わらないことを確認

🤖 Generated with Claude Code

SubjectのListフィルタで、同一子テーブル(SubjectEligibleAttribute,
SubjectRequirement)への条件が別々のサブクエリに分かれていたため、
両方指定時にAND条件として正しく機能しなかったバグを修正。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@masaya-osuga masaya-osuga requested review from a team, Copilot, hikaru-0602 and kantacky April 1, 2026 07:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect AND behavior in SubjectRepository.List when multiple filters target the same child table, by consolidating those conditions into a single subquery per table.

Changes:

  • Combine Grade + Class filters into one SubjectEligibleAttribute subquery so both apply to the same row.
  • Combine Courses + RequirementType filters into one SubjectRequirement subquery so both apply to the same row.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@hikaru-0602 hikaru-0602 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍️

@masaya-osuga masaya-osuga merged commit e16b475 into main Apr 1, 2026
8 checks passed
@masaya-osuga masaya-osuga deleted the fix/subject-list-filter-bug branch April 1, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants