Class: User

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
lib/generators/rails_jwt_api/templates/user.rb

Constant Summary collapse

EMAIL_REGEX =
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i

Instance Method Summary collapse

Instance Method Details

#detailsObject

validates :name, presence: true, length: 3, maximum: 25 validates :username, presence: true,length:3, maximum: 25



8
9
10
# File 'lib/generators/rails_jwt_api/templates/user.rb', line 8

def details
  as_json(only: [:id, :email,:created_at])
end