質問編集履歴
1
モデルの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,3 +9,37 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
また、DBにはpublic_uidカラムの追加、データの保存まではできています。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
```
|
16
|
+
|
17
|
+
user.rb
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
class User < ApplicationRecord
|
22
|
+
|
23
|
+
# Include default devise modules. Others available are:
|
24
|
+
|
25
|
+
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
26
|
+
|
27
|
+
devise :database_authenticatable, :registerable,
|
28
|
+
|
29
|
+
:recoverable, :rememberable, :validatable
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
generate_public_uid generator: PublicUid::Generators::HexStringSecureRandom.new(20)
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
def to_param
|
38
|
+
|
39
|
+
public_uid
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
```
|