質問編集履歴
1
欲しい答えをもらいやすくするため
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,9 +2,18 @@
|
|
2
2
|
|
3
3
|
#### バリデーションの記述
|
4
4
|
```
|
5
|
+
class User < ApplicationRecord
|
6
|
+
# Include default devise modules. Others available are:
|
7
|
+
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
8
|
+
devise :database_authenticatable, :registerable,
|
9
|
+
:recoverable, :rememberable, :validatable
|
10
|
+
|
11
|
+
has_many :tasks
|
12
|
+
|
5
13
|
validates :name, :email, presence: true
|
6
14
|
validates :name, length: { maximum: 6 }
|
7
15
|
validates :password, format: { with: /\A(?=.*?[a-z])(?=.*?\d)[a-z\d]{6,100}\z/i}
|
16
|
+
end
|
8
17
|
```
|
9
18
|
#### 更新をする際の記述
|
10
19
|
```
|