def self.primary_key_name : Symbol | Nil
#
class Slot
Included Modules
- Avram::PrimaryKeyMethods
- DB::Mappable
- DB::Serializable
- LuckyCache::Cachable
Defined in:
models/slot.crConstant 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
- .new(id : Int64, created_at : Time, updated_at : Time, event_id : Int64, slot_type : Int32 | Int64, slot_start : Time)
- .new(rs : DB::ResultSet)
Class Method Summary
- .column_names : Array(Symbol)
- .columns : Array(NamedTuple(name: Symbol, nilable: Bool, type: String))
- .ensure_correct_column_mappings!
- .from_rs(rs : DB::ResultSet)
- .primary_key_name : Symbol | Nil
- .schema_enforcer_validations
- .table_name : String
Instance Method Summary
- #_preloaded_responses=(vals : Array(Response)) : Array(Response)
-
#base_query_class : ::Slot::BaseQuery.class
This makes it easy for plugins and extensions to use the base SaveOperation
- #created_at : Time
- #delete_operation_class : ::Slot::DeleteOperation.class
- #event : Event
- #event! : Event
- #event_count : Int64
- #event_id : Event::PrimaryKeyType
-
#event_preloaded? : Bool
Returns
true
if the association has been preloaded - #event_query
- #id : Int64
- #responses : Array(Response)
- #responses! : Array(Response)
- #responses_count : Int64
- #responses_preloaded? : Bool
- #responses_query
- #save_operation_class : ::Slot::SaveOperation.class
- #slot_start : Time
- #slot_type : Slot::SlotType
- #updated_at : Time
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)
#
Class Method Detail
Instance Method Detail
This makes it easy for plugins and extensions to use the base SaveOperation