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

viewのコンポーネント化 #3

Merged
merged 2 commits into from
Sep 24, 2020

Conversation

soneda-yuya
Copy link
Owner

@soneda-yuya soneda-yuya commented Sep 24, 2020

  1. /productscategoriesで同じ内容を表示させていたので、コンポーネント化し共通で呼び出せるようにしました
  2. 共通化したことにより、N+1の発生箇所を見つけたのでついでに修正しました。

@@ -2,6 +2,6 @@

class CategoriesController < ApplicationController
def index
@categories = Category.all
@categories = Category.includes(:category_setting_items, [products: :product_category_settings]).all
Copy link
Owner Author

@soneda-yuya soneda-yuya Sep 24, 2020

Choose a reason for hiding this comment

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

viewのコンポーネント化をする際に呼び出し元でN+1が発生していたので修正

@soneda-yuya soneda-yuya changed the title Refactor/view component commonization viewのコンポーネント化 Sep 24, 2020
@soneda-yuya soneda-yuya merged commit 9018e0a into master Sep 24, 2020
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.

1 participant