class Chat

Included Modules

Defined in:

models/chat.cr

Constant Summary

ASSOCIATIONS = [{type: User, assoc_name: creator, foreign_key: :creator_id, relationship_type: :belongs_to, through: nil}, {type: ChatParticipant, assoc_name: participants, foreign_key: :chat_id, relationship_type: :has_many, through: nil}, {type: Character, assoc_name: characters, foreign_key: :chat_id, relationship_type: :has_many, through: [:participants, :character]}] of Nil
COLUMNS = [{name: id, type: UUID, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: creator_id, type: User::PrimaryKeyType, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: name, type: String, nilable: true, autogenerated: false, value: nil, serialized: false}] of Nil
PRIMARY_KEY_NAME = :id
PRIMARY_KEY_TYPE = UUID

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Class methods inherited from class BaseModel

database : Avram::Database.class database

Constructor Detail

def self.new(id : UUID, creator_id : Int64, name : Nil | String) #

def self.new(__temp_141 : 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(__temp_141 : DB::ResultSet) #

def self.primary_key_name : Symbol | Nil #

[View source]
def self.schema_enforcer_validations #

def self.table_name : String #

Instance Method Detail

def _preloaded_characters=(_preloaded_characters : Nil | Array(Character)) #

def _preloaded_participants=(_preloaded_participants : Nil | Array(ChatParticipant)) #

def base_query_class : ::Chat::BaseQuery.class #

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


def characters : Array(Character) #

def characters! : Array(Character) #

def characters_count : Int64 #

def characters_query #

def creator : User #

def creator! : User #

def creator_count : Int64 #

def creator_id : User::PrimaryKeyType #

def creator_id=(_creator_id : User::PrimaryKeyType::Lucky::ColumnType) #

def creator_query #

def delete_operation_class : ::Chat::DeleteOperation.class #

def id : UUID #

def id=(_id : UUID::Lucky::ColumnType) #

def name : String | Nil #

def name=(_name : String::Lucky::ColumnType | Nil) #

def participants : Array(ChatParticipant) #

def participants! : Array(ChatParticipant) #

def participants_count : Int64 #

def participants_query #

def save_operation_class : ::Chat::SaveOperation.class #

Macro Detail

macro default_columns #

[View source]