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

96 - first pass of fixing a few more n+1s #98

Merged
merged 2 commits into from
Feb 24, 2021
Merged

Conversation

mooreniemi
Copy link
Owner

@mooreniemi mooreniemi commented Feb 23, 2021

Basically everywhere you see where you should be suspicious. :)

@mooreniemi mooreniemi linked an issue Feb 23, 2021 that may be closed by this pull request
<div class="panel panel-default" itemscope itemtype="https://schema.org/MedicalProcedure">
<div class="panel-heading">
<%= @procedure.name %>
<%= link_to Pin.where(procedure_id: @procedure.id).count, pins_path(procedure: @procedure.id), { style: 'border-radius: 100%; background: #ffffcc; display:inline-block; padding:5px;' } %>
<h2><%= @procedure.name %></h2>
Copy link
Owner Author

Choose a reason for hiding this comment

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

imo the count is expensive and less readable / easy to understand than just a flat link, so for now changed it.

@mooreniemi mooreniemi merged commit 678aba3 into master Feb 24, 2021
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.

fix all n+1 queries
1 participant