-
Notifications
You must be signed in to change notification settings - Fork 1
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
memoテーブル、memoモデルにuser_nameを追加する #106
Conversation
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.
@kuri0616
コメントしました!
backend/db/Schemafile
Outdated
@@ -10,6 +10,7 @@ end | |||
create_table 'memos', charset: 'utf8mb4', collation: 'utf8mb4_0900_ai_ci', force: :cascade do |t| | |||
t.string 'title', null: false, comment: 'メモのタイトル' | |||
t.text 'content', null: false, comment: 'メモの本文' | |||
t.string 'user_name', limit: 21, null: false, comment: 'Slackのユーザー名' |
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.
[Must/Discussion]
投稿者の名前をuser_nameにしてしまうと、
単語的にusersテーブルのaccount_nameなのかなと思わせてしまいます。
contributorやposterといった命名が適切ではないでしょうか?
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.
backend/db/Schemafile
Outdated
@@ -10,6 +10,7 @@ end | |||
create_table 'memos', charset: 'utf8mb4', collation: 'utf8mb4_0900_ai_ci', force: :cascade do |t| | |||
t.string 'title', null: false, comment: 'メモのタイトル' | |||
t.text 'content', null: false, comment: 'メモの本文' | |||
t.string 'user_name', limit: 21, null: false, comment: 'Slackのユーザー名' |
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.
backend/spec/requests/memos_spec.rb
Outdated
{ title: Faker::Lorem.sentence(word_count: 3), content: Faker::Lorem.paragraph(sentence_count: 5), | ||
user_name: Faker::Name.name } |
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.
idiomatic/Nits
改行が恣意的なので、慣習的になるようにしましょう.
{ title: Faker::Lorem.sentence(word_count: 3), content: Faker::Lorem.paragraph(sentence_count: 5), | |
user_name: Faker::Name.name } | |
{ title: Faker::Lorem.sentence(word_count: 3), | |
content: Faker::Lorem.paragraph(sentence_count: 5), | |
user_name: Faker::Name.name } |
backend/spec/models/memo_spec.rb
Outdated
it 'valid?メソッドがfalseを返すこと' do | ||
expect(memo).not_to be_valid | ||
end | ||
|
||
it 'errorsに「ユーザー名を入力してください」と格納されること' do | ||
memo.valid? | ||
expect(memo.errors.full_messages).to eq ['ユーザ名を入力してください'] | ||
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.
Performant/Simple
一つのitブロックにまとめられませんか?
他の部分に関しても同様なので、修正しましょう!
(過去のレビューから学ぶことも重要です!)
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.
対応するissue
対応内容