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 Dec 19, 2024
1 parent e28acbe commit 6c26185
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 6c26185

Please sign in to comment.