Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix N+1 for user on list in nav #379

Open
mikevallano opened this issue Nov 26, 2023 · 0 comments
Open

Fix N+1 for user on list in nav #379

mikevallano opened this issue Nov 26, 2023 · 0 comments

Comments

@mikevallano
Copy link
Owner

mikevallano commented Nov 26, 2023

app/views/layouts/_header.html.erb:47

We're querying for the list owner, but we shouldn't need it?

I changed set_list in the lists_controller to @list = current_user.all_lists.find_by(slug: params[:id]), but then tests were failing and I'm not really sure what the logic is supposed to be.

We can either update the logic based on how we're using the app, or if we still need that logic, do an includes to eliminate the N+1 queries, or could cache it since lists change infrequently.

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

No branches or pull requests

1 participant