Skip to content

Fix submitted projects n plus 1#794

Draft
zetter-rpf wants to merge 2 commits intomainfrom
fix-submitted-projects-n-plus-1
Draft

Fix submitted projects n plus 1#794
zetter-rpf wants to merge 2 commits intomainfrom
fix-submitted-projects-n-plus-1

Conversation

@zetter-rpf
Copy link
Copy Markdown
Contributor

Status

  • Closes add issue numbers or delete
  • Related to add issue numbers or delete

Points for consideration:

  • Security
  • Performance

What's changed?

Description of what's been done - bullets are often best

Steps to perform after deploying to production

If the production environment requires any extra work after this PR has been deployed detail it here. This could be running a Rake task, a migration, or upgrading a Gem. That kind of thing.

Note that you will need to have asdf on your non-interactive shell path for this to work. If you see a bunder not installed message this is likely the cause.

You can fix this by making sure asdf is added to your path in your zprofile instead of your zshrc.

I've added the rspec bin stub as part of this as it's quicker than typing bundle exec and simpler than using it in the tasks.json
@cla-bot cla-bot Bot added the cla-signed label Apr 27, 2026
@zetter-rpf zetter-rpf force-pushed the fix-submitted-projects-n-plus-1 branch from d4a395d to d0c2a49 Compare April 27, 2026 15:50
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

Test coverage

89.41% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/25005988218

@zetter-rpf zetter-rpf force-pushed the fix-submitted-projects-n-plus-1 branch 2 times, most recently from ebd5795 to 4080188 Compare April 27, 2026 16:04
While we have bullet, but it wasn't failing because there wasn't enough test data set up.

Since the extra includes is only used by teachers, I've had to change the controller action around bit.

Newer version of rails have a 'strict_loading' mode which can help prevent N+1 queries, however I don't want to introduce it until after we upgrade to rails 8 and can configure the 'strict_loading_mode' to only n+1 queries otherwise there is a lot of noise from single queries[1].

[1] - https://thoughtbot.com/blog/strict-loading-in-rails-8-a-railsy-way-to-avoid-n-1-queries
@zetter-rpf zetter-rpf force-pushed the fix-submitted-projects-n-plus-1 branch from 4080188 to 0a46ba4 Compare April 27, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant