class Slot

Included Modules

Defined in:

models/slot.cr

Constant Summary

ASSOCIATIONS = [{type: Event, assoc_name: event, foreign_key: :event_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}, {type: Response, assoc_name: responses, foreign_key: :slot_id, relationship_type: :has_many, through: nil, base_query_class: Response::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: event_id, type: Event::PrimaryKeyType, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: slot_type, type: Slot::SlotType, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: slot_start, type: Time, nilable: false, autogenerated: false, 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

Constructor Detail

def self.new(id : Int64, created_at : Time, updated_at : Time, event_id : Int64, slot_type : Int32 | Int64, slot_start : 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_responses=(vals : Array(Response)) : Array(Response) #

def base_query_class : ::Slot::BaseQuery.class #

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


def created_at : Time #

def delete_operation_class : ::Slot::DeleteOperation.class #

def event : Event #

def event! : Event #

def event_count : Int64 #

def event_id : Event::PrimaryKeyType #

def event_preloaded? : Bool #

Returns true if the association has been preloaded


def event_query #

def id : Int64 #

def responses : Array(Response) #

def responses! : Array(Response) #

def responses_count : Int64 #

def responses_preloaded? : Bool #

def responses_query #

def save_operation_class : ::Slot::SaveOperation.class #

def slot_start : Time #

def slot_type : Slot::SlotType #

def updated_at : Time #