Skip to content

Commit

Permalink
Merge pull request #2 from alexandruclapou/hotfix/fixed-np1-queries
Browse files Browse the repository at this point in the history
n+1 queries problem fixed
  • Loading branch information
alexandruclapou authored Feb 25, 2022
2 parents d14c485 + 558ccec commit a25fc77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ GEM

PLATFORMS
x86_64-darwin-20
x86_64-darwin-21

DEPENDENCIES
bootsnap (>= 1.4.4)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/scores_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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).includes(:user)
serialized_scores = scores.map(&:serialize)

response = {
Expand Down

0 comments on commit a25fc77

Please sign in to comment.