Skip to content

Commit

Permalink
Fix N+1 issue in seeds
Browse files Browse the repository at this point in the history
This fixes an N+1 issue in the seeds that is raised now that strict
loading has been enabled globally.
  • Loading branch information
thomasleese committed Jan 5, 2025
1 parent 0b3a372 commit 771933e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def create_patients(organisation)
end

def create_imports(user, organisation)
programme = organisation.programmes.find_by(type: "hpv")
programme = organisation.programmes.includes(:sessions).find_by(type: "hpv")

%i[pending invalid processed].each do |status|
FactoryBot.create(
Expand Down

0 comments on commit 771933e

Please sign in to comment.