-
Notifications
You must be signed in to change notification settings - Fork 0
事業課題2: 実装 #2
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
base: develop
Are you sure you want to change the base?
事業課題2: 実装 #2
Conversation
tarakish
left a comment
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.
ご提出ありがとうございます。
全体的に良く実装できていて概ね問題ないと思います!
細かいですが修正点について2点コメントしましたのでご修正と再提出をお願いします!
| def create | ||
| current_user.follow(params[:user_id]) | ||
| redirect_back fallback_location: users_path | ||
| end | ||
|
|
||
| def destroy | ||
| current_user.unfollow(params[:user_id]) | ||
| redirect_back fallback_location: users_path | ||
| end |
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.
モデルにロジックを寄せられていて良いですね👍
app/views/events/_attendee.html.erb
Outdated
| <%= attendee.name %> | ||
| </div> | ||
| <%= link_to attendee.name, user_path(attendee) %> | ||
| </div> |
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.
細かいですがインデントがズレているので修正しましょう!
| belongs_to :follower, class_name: "User" | ||
| belongs_to :followed, class_name: "User" | ||
| validates :follower_id, presence: true | ||
| validates :followed_id, presence: true |
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.
念のためfollower_idとfollowed_idで複合ユニーク制約をつけておくと良さそうです。
|
ご指摘いただきありがとうございます。以下2点修正いたしました。ご確認よろしくお願いいたします。 課題内容に関係ないかもしれませんが、ログインしていない状態でユーザー詳細画面にアクセスした場合にNoMethodErrorが表示されるのが気になったため、app/views/users/show.html.erbを修正しました。 |
|
良いと思います 👍🏻 |
【選択した事業課題】
2. 直近一年間で、2回以上もくもく会に参加してくれた人は利用者全体の1%のみ。もくもく会で気の合う仲間を見つけられなかったのではないか?