Skip to content

Conversation

@secretpray
Copy link
Contributor

Summary

  • Add .includes(:identity) to UsersController#index to preload identities when rendering user JSON (fixes N+1 on user.identity.email_address)
  • Add .includes(creator: :identity) to BoardsController#index to preload board creators with their identities
  • Add .includes(:identity) to BoardsController#edit for the users list

Test plan

  • Added N+1 regression tests for UsersController#index and BoardsController#index
  • Tests verify exactly 1 query per association (no N+1)
  • bin/rails test test/controllers/users_controller_test.rb test/controllers/boards_controller_test.rb

- Add .includes(:identity) to UsersController#index
- Add .includes(creator: :identity) to BoardsController#index
- Add N+1 regression tests for both controllers
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.

1 participant