class SpecimenLabel

Included Modules

Defined in:

models/specimen_label.cr

Constant Summary

ASSOCIATIONS = [{type: SpecimenLabelLabelSpecimen, assoc_name: label_specimens, foreign_key: :specimen_label_id, relationship_type: :has_many, through: nil, base_query_class: SpecimenLabelLabelSpecimen::BaseQuery}] of Nil
COLUMNS = [{name: id, type: UUID, 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: user_id, type: Int32, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: name, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}] of Nil
PRIMARY_KEY_NAME = :id
PRIMARY_KEY_TYPE = UUID

Constructors

Class Method Summary

Macro 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

Macros inherited from class BaseModel

default_columns default_columns

Constructor Detail

def self.new(id : UUID, created_at : Time, user_id : Int32 | Nil, name : String) #

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 #

[View source]
def self.schema_enforcer_validations #

def self.table_name : String #

Macro Detail

macro default_columns #

[View source]

Instance Method Detail

def _preloaded_label_specimens=(vals : Array(SpecimenLabelLabelSpecimen)) : Array(SpecimenLabelLabelSpecimen) #

def base_query_class : ::SpecimenLabel::BaseQuery.class #

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


def created_at : Time #

def delete_operation_class : ::SpecimenLabel::DeleteOperation.class #

def id : UUID #

def label_specimens : Array(SpecimenLabelLabelSpecimen) #

def label_specimens! : Array(SpecimenLabelLabelSpecimen) #

def label_specimens_count : Int64 #

def label_specimens_preloaded? : Bool #

def label_specimens_query #

def name : String #

def save_operation_class : ::SpecimenLabel::SaveOperation.class #

def user_id : Int32 | Nil #