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

レコード作成時にteacherが木実太郎になるバグを修正する #218

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

takumi0616
Copy link
Collaborator

対応Issue

resolve #217

概要

レコード作成時に、どのteacherを選んでも木実太郎になるバグの修正

実装内容

  • handleTeacherのアロー関数で空かっこが挟まれている、= () =>を使うときは、引数がない場合に使うものなので、その部分を消去した
  • recordを作っているrecords_controller.rbを見に行くと、record_idはRecordAddModalから持ってきているわけではない(record_id: @record.id)ことが分かったので、RecordAddModalのrecord_id部分を消した
  • user_idはRecordAddModal以外ではstring型のみのところ(pages/records/index.tsx)があったのでuser_idをstring型のみにした

画面スクリーンショット等

http://localhost:8080/records
PR用テストにおいて、きちんとteacherが反映されている
image

http://localhost:8080/records/39
PR用テストで、編集したteacherが反映されている
image

テスト項目

  • [ レコード作成時のteacherで木実太郎以外を選び、作成されたレコードのteacherが正しく反映されている]
  • [レコードの編集でteacherを変えても、teacherが変更される]

備考

本番環境のSeedsでも同じなのだが、teacherがnullのレコードを編集しようとするとエラーが出る

@vercel
Copy link

vercel bot commented Jul 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nutmeg-seeds ✅ Ready (Inspect) Visit Preview Jul 5, 2023 1:49am

@github-actions github-actions bot added the enhancement New feature or request label Jul 5, 2023
@imaimai17468 imaimai17468 self-requested a review July 5, 2023 09:47
@imaimai17468 imaimai17468 merged commit bfe62a9 into develop Jul 8, 2023
@imaimai17468 imaimai17468 deleted the feature/takasuka/217-teacher-name-bug branch July 8, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

レコード作成時にteacherが木実太郎になるバグを修正する
2 participants