class

User

Inherits DB::Mappable < DB::Serializable < Reference < Object

Constructors

create(name : String, email : String, password : String | Nil, role_name : String | Nil = nil, db_conn : DB::Connection | DB::Database = Pared::Database.connection) : User
Source
new(name : String, email : String, password_hash : String | Nil, id : Int64 | Nil = nil, created_at : String = Time.utc.to_s, updated_at : String = Time.utc.to_s)
Source

Class methods

authenticate(email : String, password : String) : User | Nil
Source
delete(id : Int64, db_conn : DB::Connection | DB::Database = Pared::Database.connection)
Source
find(id : Int64) : User | Nil
Source
find_by_email(email : String, db_conn : DB::Connection | DB::Database = Pared::Database.connection) : User | Nil
Source
from_rs(rs : DB::ResultSet)
Source
normalize_email(value : String) : String
Source

Instance methods

created_at
Source
email
Source
has_permission?(permission : String) : Bool
Source
name
Source
password_hash
Source
permissions
Source
roles
Source
update_name(new_name : String)
Source
update_role(role_name : String, db_conn : DB::Connection | DB::Database = Pared::Database.connection)
Source
updated_at
Source
username
Source