def self.primary_key_name : Symbol | Nil
#
class Character
Included Modules
- Avram::PrimaryKeyMethods
- DB::Mappable
- LuckyCache::Cachable
Defined in:
models/character.crConstant 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
- .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)
- .new(__temp_111 : DB::ResultSet)
Class Method Summary
- .column_names : Array(Symbol)
- .columns : Array(NamedTuple(name: Symbol, nilable: Bool, type: String))
- .ensure_correct_column_mappings!
- .from_rs(__temp_111 : DB::ResultSet)
- .primary_key_name : Symbol | Nil
- .schema_enforcer_validations
- .table_name : String
Instance Method Summary
- #_preloaded_chat_participations=(_preloaded_chat_participations : Nil | Array(ChatParticipant))
- #_preloaded_chats=(_preloaded_chats : Nil | Array(Chat))
- #avatar_id : String | Nil
- #avatar_id=(_avatar_id : String::Lucky::ColumnType | Nil)
-
#base_query_class : ::Character::BaseQuery.class
This makes it easy for plugins and extensions to use the base SaveOperation
- #chat_participations : Array(ChatParticipant)
- #chat_participations! : Array(ChatParticipant)
- #chat_participations_count : Int64
- #chat_participations_query
- #chats : Array(Chat)
- #chats! : Array(Chat)
- #chats_count : Int64
- #chats_query
- #created_at : Time
- #created_at=(_created_at : Time::Lucky::ColumnType)
- #creator : User
- #creator! : User
- #creator_count : Int64
- #creator_id : User::PrimaryKeyType
- #creator_id=(_creator_id : User::PrimaryKeyType::Lucky::ColumnType)
- #creator_query
- #delete_operation_class : ::Character::DeleteOperation.class
- #description : String
- #description=(_description : String::Lucky::ColumnType)
- #example_chats : String | Nil
- #example_chats=(_example_chats : String::Lucky::ColumnType | Nil)
- #greeting : String
- #greeting=(_greeting : String::Lucky::ColumnType)
- #id : Int64
- #id=(_id : Int64::Lucky::ColumnType)
- #is_contentious : Bool
- #is_contentious=(_is_contentious : Bool::Lucky::ColumnType)
- #is_contentious? : Bool
- #name : String
- #name=(_name : String::Lucky::ColumnType)
- #persona : String
- #persona=(_persona : String::Lucky::ColumnType)
- #save_operation_class : ::Character::SaveOperation.class
- #slug : String
- #slug=(_slug : String::Lucky::ColumnType)
- #updated_at : Time
- #updated_at=(_updated_at : Time::Lucky::ColumnType)
- #visibility : String
- #visibility=(_visibility : String::Lucky::ColumnType)
- #world_scenario : String | Nil
- #world_scenario=(_world_scenario : String::Lucky::ColumnType | Nil)
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)
#
Class Method Detail
Instance Method Detail
def _preloaded_chat_participations=(_preloaded_chat_participations : Nil | Array(ChatParticipant))
#
This makes it easy for plugins and extensions to use the base SaveOperation