Class: User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- User
- Defined in:
- app/models/user.rb
Overview
Schema Information
Table name: users
id :integer not null, primary key
email :string(255) not null
name :string(100)
password_digest :string(60)
created_at :datetime not null
updated_at :datetime not null
nickname :string(100)
Constant Summary collapse
- VALID_NAME_REGEX =
/^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]{1,50}$/
- VALID_EMAIL_REGEX =
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
Instance Method Summary collapse
Instance Method Details
#to_s ⇒ Object
33 34 35 |
# File 'app/models/user.rb', line 33 def to_s self.nickname || self.name || "_guest" end |