class User

Included Modules

Defined in:

models/user.cr

Constant Summary

ASSOCIATIONS = [{type: BearerLogin, assoc_name: bearer_logins, foreign_key: :user_id, relationship_type: :has_many, through: nil, base_query_class: BearerLogin::BaseQuery}, {type: EmailConfirmation, assoc_name: email_confirmations, foreign_key: :user_id, relationship_type: :has_many, through: nil, base_query_class: EmailConfirmation::BaseQuery}, {type: Login, assoc_name: logins, foreign_key: :user_id, relationship_type: :has_many, through: nil, base_query_class: Login::BaseQuery}, {type: PasswordReset, assoc_name: password_resets, foreign_key: :user_id, relationship_type: :has_many, through: nil, base_query_class: PasswordReset::BaseQuery}] of Nil
COLUMNS = [{name: email, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: password_digest, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: settings, type: UserSettings, nilable: false, autogenerated: false, value: nil, serialized: true, allow_blank: false}, {name: id, type: Int64, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}, {name: created_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}, {name: first_name, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: last_name, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: level, type: UserLevel, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: updated_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}] of Nil
PRIMARY_KEY_NAME = :id
PRIMARY_KEY_TYPE = Int64

Constructors

Class Method Summary

Instance Method Summary

Constructor methods inherited from class BaseModel

new(rs : DB::ResultSet) new

Class methods inherited from class BaseModel

database : Avram::Database.class database, from_rs(rs : DB::ResultSet) from_rs

Macros inherited from class BaseModel

default_columns default_columns

Constructor Detail

def self.new(email : String, password_digest : String, settings : UserSettings, id : Int64, created_at : Time, first_name : String, last_name : String, level : String, updated_at : Time) #

def self.new(rs : DB::ResultSet) #

Class Method Detail

def self.column_names : Array(Symbol) #

def self.columns : Array(NamedTuple(name: Symbol, nilable: Bool, type: String)) #

def self.ensure_correct_column_mappings! #

def self.from_rs(rs : DB::ResultSet) #

def self.primary_key_name : Symbol | Nil #

def self.schema_enforcer_validations #

def self.table_name : String #

Instance Method Detail

def _preloaded_bearer_logins=(vals : Array(BearerLogin)) : Array(BearerLogin) #

def _preloaded_email_confirmations=(vals : Array(EmailConfirmation)) : Array(EmailConfirmation) #

def _preloaded_logins=(vals : Array(Login)) : Array(Login) #

def _preloaded_password_resets=(vals : Array(PasswordReset)) : Array(PasswordReset) #

def base_query_class : ::User::BaseQuery.class #

This makes it easy for plugins and extensions to use the base SaveOperation


def bearer_logins : Array(BearerLogin) #

def bearer_logins! : Array(BearerLogin) #

def bearer_logins_count : Int64 #

def bearer_logins_preloaded? : Bool #

def bearer_logins_query #

def created_at : Time #

def delete_operation_class : ::User::DeleteOperation.class #

def email : String #

def email_confirmations : Array(EmailConfirmation) #

def email_confirmations! : Array(EmailConfirmation) #

def email_confirmations_count : Int64 #

def email_confirmations_preloaded? : Bool #

def email_confirmations_query #

def emailable : Carbon::Address #

[View source]
def first_name : String #

def full_name : String #

[View source]
def id : Int64 #

def last_name : String #

def level : UserLevel #

def logins : Array(Login) #

def logins! : Array(Login) #

def logins_count : Int64 #

def logins_preloaded? : Bool #

def logins_query #

def password_digest : String #

def password_resets : Array(PasswordReset) #

def password_resets! : Array(PasswordReset) #

def password_resets_count : Int64 #

def password_resets_preloaded? : Bool #

def password_resets_query #

def save_operation_class : ::User::SaveOperation.class #

def settings : UserSettings #

def updated_at : Time #