class Character

Included Modules

Defined in:

models/character.cr

Constant Summary

ASSOCIATIONS = [{type: User, assoc_name: creator, foreign_key: :creator_id, relationship_type: :belongs_to, through: nil}, {type: ChatParticipant, assoc_name: chat_participations, foreign_key: :character_id, relationship_type: :has_many, through: nil}, {type: Chat, assoc_name: chats, foreign_key: :character_id, relationship_type: :has_many, through: [:chat_participations, :chat]}] of Nil
COLUMNS = [{name: id, type: Int64, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: created_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: updated_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: slug, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: name, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: description, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: avatar_id, type: String, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: greeting, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: persona, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: world_scenario, type: String, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: example_chats, type: String, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: visibility, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: is_contentious, type: Bool, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: creator_id, type: User::PrimaryKeyType, nilable: false, autogenerated: false, value: nil, serialized: false}] of Nil
PRIMARY_KEY_NAME = :id
PRIMARY_KEY_TYPE = Int64
VALID_VISIBILITY_VALUES = ["public", "unlisted", "private"]

Constructors

Class Method Summary

Instance Method Summary

Class methods inherited from class BaseModel

database : Avram::Database.class database

Constructor Detail

def self.new(id : Int64, created_at : Time, updated_at : Time, slug : String, name : String, description : String, avatar_id : Nil | String, greeting : String, persona : String, world_scenario : Nil | String, example_chats : Nil | String, visibility : String, is_contentious : Bool, creator_id : Int64) #

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

def self.primary_key_name : Symbol | Nil #

def self.schema_enforcer_validations #

def self.table_name : String #

Instance Method Detail

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

def _preloaded_chats=(_preloaded_chats : Nil | Array(Chat)) #

def avatar_id : String | Nil #

def avatar_id=(_avatar_id : String::Lucky::ColumnType | Nil) #

def base_query_class : ::Character::BaseQuery.class #

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


def chat_participations : Array(ChatParticipant) #

def chat_participations! : Array(ChatParticipant) #

def chat_participations_count : Int64 #

def chat_participations_query #

def chats : Array(Chat) #

def chats! : Array(Chat) #

def chats_count : Int64 #

def chats_query #

def created_at : Time #

def created_at=(_created_at : Time::Lucky::ColumnType) #

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 : ::Character::DeleteOperation.class #

def description : String #

def description=(_description : String::Lucky::ColumnType) #

def example_chats : String | Nil #

def example_chats=(_example_chats : String::Lucky::ColumnType | Nil) #

def greeting : String #

def greeting=(_greeting : String::Lucky::ColumnType) #

def id : Int64 #

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

def is_contentious : Bool #

def is_contentious=(_is_contentious : Bool::Lucky::ColumnType) #

def is_contentious? : Bool #

def name : String #

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

def persona : String #

def persona=(_persona : String::Lucky::ColumnType) #

def save_operation_class : ::Character::SaveOperation.class #

def slug : String #

def slug=(_slug : String::Lucky::ColumnType) #

def updated_at : Time #

def updated_at=(_updated_at : Time::Lucky::ColumnType) #

def visibility : String #

def visibility=(_visibility : String::Lucky::ColumnType) #

def world_scenario : String | Nil #

def world_scenario=(_world_scenario : String::Lucky::ColumnType | Nil) #