-
Notifications
You must be signed in to change notification settings - Fork 77
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 plus one #228
Fix n plus one #228
Conversation
* Removed few N+1 queries across different navbar tabs * code review changes
Current Code Coverage Percent of this PR:78.65 %Files having coverage below 100%
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
@@ -10,6 +10,6 @@ module CurrentCompanyConcern | |||
def current_company | |||
return if current_user.nil? | |||
|
|||
@_current_company ||= current_user&.current_workspace || current_user.companies.first | |||
@_current_company ||= current_user&.current_workspace || current_user.companies.includes(:logo_attachment).first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put current_user.companies.includes(:logo_attachment).first
inside current_workspace
method? @alkesh26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keshavbiswa I am not fully aware of the current_workspace context here and the impact if we change the method to companies.includes(:logo_attachment).first
. We will discuss this tomorrow. For now I will merge this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Notion card
https://saeloun.notion.site/Fix-N-1-query-f7836df2aff240ed8e1b51683c95d920
Summary
Type of change
Please delete options that are not relevant.
Checklist: