class BearerLogin

Included Modules

Defined in:

models/bearer_login.cr

Constant Summary

ASSOCIATIONS = [{type: User, assoc_name: user, foreign_key: :user_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}] of Nil
COLUMNS = [{name: user_id, type: User::PrimaryKeyType, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: active_at, type: Time, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: inactive_at, type: Time, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: name, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: scopes, type: Array(String), nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: token_digest, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: id, type: Int64, 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(user_id : Int64, active_at : Time, inactive_at : Time | Nil, name : String, scopes : Array(String), token_digest : String, id : Int64) #

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 active_at : Time #

def base_query_class : ::BearerLogin::BaseQuery.class #

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


def delete_operation_class : ::BearerLogin::DeleteOperation.class #

def id : Int64 #

def inactive_at : Time | Nil #

def name : String #

def save_operation_class : ::BearerLogin::SaveOperation.class #

def scopes : Array(String) #

def status : RecordStatus #

def token_digest : String #

def user : User #

def user! : User #

def user_count : Int64 #

def user_id : User::PrimaryKeyType #

def user_preloaded? : Bool #

def user_query #