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

Fixed n+1 queries problem #1

Closed
wants to merge 1 commit into from
Closed

Fixed n+1 queries problem #1

wants to merge 1 commit into from

Conversation

SergiuCiupeGG
Copy link
Owner

Fixes: AACraiu#1

Changes

Fixed the n+1 queries problem that was lazy loading, now eager loads.

Before

Screenshot 2022-02-07 at 15 03 28

After

Screenshot 2022-02-07 at 15 04 42

@@ -5,7 +5,8 @@ class ScoresController < ApplicationController
before_action :validate_score_user_id, only: :destroy

def user_feed
scores = Score.all.order(played_at: :desc, id: :desc)
#scores = Score.all.order(played_at: :desc, id: :desc)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/LeadingCommentSpace: Missing space after #.

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.

Improve scores feed performance
1 participant