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

指摘部分を修正しました。 #7

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

Mikiko9882
Copy link

使っていないファイルは削除し、共通化してbefore_actionしました。
[Image from Gyazo](url)

Copy link

@busitora busitora left a comment

Choose a reason for hiding this comment

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

あと一歩!コメントしました!


# フォローを外すときの処理
def unfollow(user_id)
followers.find_by(followed_id: user_id).destroy

Choose a reason for hiding this comment

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

ollowers.find_by(followed_id: user_id) の結果がnilの場合、 nil.destroy でエラーになるので、早期 return や ぼっち演算子で対応お願いします!

@@ -0,0 +1,6 @@
FactoryBot.define do
factory :relationship do
follower_id { 1 }

Choose a reason for hiding this comment

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

1や2 といった数字はマジックナンバーになるため、修正しましょう!

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.

3 participants