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

プラクティス一覧画面にアクセス時のN+1を解消 #3526

Merged
merged 6 commits into from
Nov 11, 2021

Conversation

shibaaaa
Copy link
Contributor

@shibaaaa shibaaaa commented Nov 6, 2021

Description

プラクティス一覧画面に遷移時、practicesテーブルにカテゴリーの数分クエリが発行されていたので、一回のクエリで済むように修正しました。
practicesテーブルからstatusがcompleteのものをカウントし、category_idでグルーピングするように変更しています。

app/models/user.rb Outdated Show resolved Hide resolved
Copy link
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

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

確認しました、ありがとうございます〜!

@komagata komagata merged commit 634a50a into fjordllc:main Nov 11, 2021
@github-actions github-actions bot mentioned this pull request Nov 11, 2021
22 tasks
@shibaaaa shibaaaa deleted the turning_practices_index branch November 11, 2021 11:16
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.

2 participants