class Model::JobStatus

Included Modules

Extended Modules

Defined in:

models/job_status.cr

Constant Summary

CRECTO_DESTROY_ASSOCIATIONS = Array(Symbol).new
CRECTO_ENUM_FIELDS = [] of NamedTuple(name: Symbol, type: String, column_name: String, column_type: String)
CRECTO_FIELDS = [{name: :job_id, type: Int32}, {name: :status, type: String}, {name: :response, type: String}] of NamedTuple(name: Symbol, type: String)
CRECTO_MODEL_FIELDS = [] of NamedTuple(name: Symbol, type: String)
CRECTO_NULLIFY_ASSOCIATIONS = Array(Symbol).new
CRECTO_PRIMARY_KEY_FIELD = "id"
CRECTO_PRIMARY_KEY_FIELD_SYMBOL = :id
CRECTO_PRIMARY_KEY_FIELD_TYPE = "Int32"
CRECTO_VALID_FIELD_OPTIONS = [:primary_key, :virtual, :default]
CRECTO_VALID_FIELD_TYPES = [String, Int64, Int32, Int16, Float32, Float64, Bool, Time, Int32 | Int64, Float32 | Float64, Json, PkeyValue, Array(String), Array(Int64), Array(Int32), Array(Int16), Array(Float32), Array(Float64), Array(Bool), Array(Time), Array(Int32 | Int64), Array(Float32 | Float64), Array(Json), Array(PkeyValue)]

macro constants

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

def self.new(__temp_120 : DB::ResultSet) #

def self.new #

[View source]

Class Method Detail

def self.add_destroy_association(a) #

[View source]
def self.add_nullify_association(a) #

[View source]
def self.association_type_for_association(association : Symbol) #

[View source]
def self.cast(attributes : NamedTuple, whitelist : Tuple = attributes.keys) #

[View source]
def self.cast(attributes : Hash(Symbol, T), whitelist : Array(Symbol) = attributes.keys) forall T #

[View source]
def self.cast(attributes : Hash(String, T), whitelist : Array(String) = attributes.keys) forall T #

[View source]
def self.cast(**attributes) #

Class methods for mass assignment


[View source]
def self.cast!(attributes : NamedTuple) #

[View source]
def self.cast!(**attributes : **T) forall T #

Class methods for compile-time type safe mass assignment


[View source]
def self.changeset_fields #

Class method to get the .changeset_fields


[View source]
def self.created_at_field #

[View source]
def self.destroy_associations #

[View source]
def self.fields #

[View source]
def self.foreign_key_for_association(association : Symbol) : Symbol | Nil #

[View source]
def self.foreign_key_for_association(klass : Crecto::Model.class) #

[View source]
def self.foreign_key_value_for_association(association : Symbol, item) #

[View source]
def self.from_rs(__temp_120 : DB::ResultSet) #

def self.klass_for_association(association : Symbol) #

Empty association methods Implementations are in the setup_association macro


[View source]
def self.nullify_associations #

[View source]
def self.primary_key_field #

Return the primary key field as a String


[View source]
def self.primary_key_field_symbol #

Return the primary key field as a Symbol


[View source]
def self.set_value_for_association(association : Symbol, item, items) #

[View source]
def self.table_name #

Class method to get the table name


[View source]
def self.through_key_for_association(association : Symbol) : Symbol | Nil #

[View source]
def self.updated_at_field #

[View source]
def self.use_primary_key? #

[View source]
def self.validate(message : String, block : Model::JobStatus -> _) #

Validates generic block against an instance of the class


Instance Method Detail

def cast(attributes : NamedTuple, whitelist : Tuple = attributes.keys) #

def cast(attributes : Hash(Symbol, T), whitelist : Array(Symbol) = attributes.keys) forall T #

def cast(attributes : Hash(String, T), whitelist : Array(String) = attributes.keys) forall T #

def cast(**attributes : **T) forall T #

Empty instance methods for mass assignment Implementations are in the Schema.setup macro


def cast!(attributes : NamedTuple) #

[View source]
def cast!(**attributes : **T) forall T #

Instance method for compile-time type safe mass assignment


[View source]
def created_at : Time? #

def created_at=(_created_at : Time | Nil) #

def created_at_to_now #

def created_at_value #

def get_changeset #

[View source]
def id : Int32? #

def id=(_id : Int32 | Nil) #

def initial_values : Hash(Symbol, DbValue) | Nil #

def initial_values=(initial_values : Hash(Symbol, DbValue) | Nil) #

def job_id : Int32? #

def job_id! #

Builds fields' cast typed method


def job_id=(_job_id : Int32 | Nil) #

def pkey_value #

Returns the value of the primary key field


def response : String? #

def response! #

def response=(_response : String | Nil) #

def status : String? #

def status! #

def status=(_status : String | Nil) #

def to_query_hash(include_virtual = false) #

Builds a hash from all CRECTO_FIELDS defined


def update_from_hash(hash : Hash(String, DbValue)) #

def update_primary_key(val) #

def updated_at : Time? #

def updated_at=(_updated_at : Time | Nil) #

def updated_at_to_now #

def updated_at_value #