22#
33# Table name: users
44#
5- # id :bigint not null, primary key
6- # age(年龄) :string(255)
7- # email(邮箱) :string(255)
8- # name(用户名) :string(255)
9- # password_digest(密码) :string(255)
10- # sex(性别) :boolean
11- # created_at :datetime not null
12- # updated_at :datetime not null
5+ # id :bigint not null, primary key
6+ # age(年龄) :string(255)
7+ # email(邮箱) :string(255)
8+ # encrypted_password :string(255) default(""), not null
9+ # name(用户名) :string(255)
10+ # password_digest(密码) :string(255)
11+ # remember_created_at :datetime
12+ # reset_password_sent_at :datetime
13+ # reset_password_token :string(255)
14+ # sex(性别) :boolean
15+ # created_at :datetime not null
16+ # updated_at :datetime not null
17+ #
18+ # Indexes
19+ #
20+ # index_users_on_email (email) UNIQUE
21+ # index_users_on_reset_password_token (reset_password_token) UNIQUE
1322#
1423
1524class User < ApplicationRecord
@@ -26,4 +35,10 @@ class User < ApplicationRecord
2635 # user.password_digest # => "$2a$10$4LEA7r4YmNHtvlAvHhsYAeZmk/xeUVtMTYqwIvYY76EW5GUqDiP4." 对password加密后的密码
2736 has_secure_password
2837
38+ # Include default devise modules. Others available are:
39+ # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
40+ devise :database_authenticatable , :registerable ,
41+ :recoverable , :rememberable , :validatable
42+
43+
2944end
0 commit comments