質問編集履歴

1

編集ミスの修正

2019/07/22 18:08

投稿

shumbow
shumbow

スコア35

test CHANGED
File without changes
test CHANGED
@@ -4,13 +4,13 @@
4
4
 
5
5
  50.times do |n|
6
6
 
7
- name = Faker::JapaneseMedia::DragonBall.character
7
+ name = Faker::name
8
8
 
9
9
  email = "example-#{n+1}@railstutorial.org"
10
10
 
11
11
  password = "password"
12
12
 
13
- User.create!(name: name,
13
+ User.create!(name: name,
14
14
 
15
15
  email: email,
16
16
 
@@ -22,8 +22,20 @@
22
22
 
23
23
  activated_at: Time.zone.now
24
24
 
25
- )
25
+         birth_date: ?)ここがわからない
26
26
 
27
27
  end
28
28
 
29
29
  ```
30
+
31
+ カラム名はbirth_dateでもparamsで送られてくるときは
32
+
33
+ birth_date(1i): '2019'
34
+
35
+ birth_date(2i): '7'
36
+
37
+ birth_date(3i): '23'
38
+
39
+ このようにdate型専用のフォーマットになっています。どなたかご存知の方いないでしょうか?
40
+
41
+ ランダムな値とかでなくても固定値でもいいです。