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

Changes to be committed: Solving the n+1 queries problem #1

Closed
wants to merge 1 commit into from

Conversation

LuigiRusu
Copy link
Owner

@LuigiRusu LuigiRusu commented Mar 29, 2022

Fixes :
#1: Solving n+1 queries problem using eager loading.

Changes :
I switch scores = Score.all.order(played_at: :desc, id: :desc)
with scores = Score.all.includes(:user).order(played_at: :desc, id: :desc)

Before

Screenshot 2022-03-29 at 14 05 54

After

Screenshot 2022-03-29 at 14 25 55

	modified:   Gemfile.lock
	modified:   app/controllers/api/scores_controller.rb
@LuigiRusu LuigiRusu closed this Mar 29, 2022
@LuigiRusu LuigiRusu deleted the hotfix/myhotfix branch March 29, 2022 11:46
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