Skip to content

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

Open
Mikiko9882 wants to merge 13 commits intoyusukedayo:developfrom
Mikiko9882:mokumoku2
Open

指摘部分を修正しました。#7
Mikiko9882 wants to merge 13 commits intoyusukedayo:developfrom
Mikiko9882:mokumoku2

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