class Event

Included Modules

Defined in:

models/event.cr

Constant Summary

ASSOCIATIONS = [{type: Slot, assoc_name: slots, foreign_key: :event_id, relationship_type: :has_many, through: nil, base_query_class: Slot::BaseQuery}, {type: Guest, assoc_name: guests, foreign_key: :event_id, relationship_type: :has_many, through: nil, base_query_class: Guest::BaseQuery}] of Nil
COLUMNS = [{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: updated_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}, {name: name, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: host_name, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: event_uuid, type: String, nilable: false, autogenerated: false, value: UUID.v7.to_s, 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

Constructor Detail

def self.new(id : Int64, created_at : Time, updated_at : Time, name : String, host_name : String, event_uuid : String) #

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_guests=(vals : Array(Guest)) : Array(Guest) #

def _preloaded_slots=(vals : Array(Slot)) : Array(Slot) #

def base_query_class : ::Event::BaseQuery.class #

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


def created_at : Time #

def delete_operation_class : ::Event::DeleteOperation.class #

def event_uuid : String #

def guests : Array(Guest) #

def guests! : Array(Guest) #

def guests_count : Int64 #

def guests_preloaded? : Bool #

def guests_query #

def host_name : String #

def id : Int64 #

def name : String #

def save_operation_class : ::Event::SaveOperation.class #

def slots : Array(Slot) #

def slots! : Array(Slot) #

def slots_count : Int64 #

def slots_preloaded? : Bool #

def slots_query #

def updated_at : Time #