Return the primary key field as a String
Model::ViewJobStatus
Inherits DB::Mappable < JSON::Serializable < Crecto::Schema::BelongsTo < Crecto::Schema::HasOne < Crecto::Schema::HasMany < Crecto::Schema < Crecto::Model < Reference < Object
Constants
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: :job, type: String}, {name: :description, type: String}, {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
new(pull : JSON::PullParser)
new(__temp_220 : DB::ResultSet)
new
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
Class methods
add_destroy_association(a)
Sourceadd_nullify_association(a)
Sourceassociation_type_for_association(association : Symbol)
Sourcecast(attributes : NamedTuple, whitelist : Tuple = attributes.keys)
Sourcecast(attributes : Hash(Symbol, T), whitelist : Array(Symbol) = attributes.keys) forall T
Sourcecast(attributes : Hash(String, T), whitelist : Array(String) = attributes.keys) forall T
Sourcecast!(attributes : NamedTuple)
Sourcecreated_at_field
Sourcedestroy_associations
Sourcefields
Sourceforeign_key_for_association(association : Symbol) : Symbol | Nil
Sourceforeign_key_for_association(klass : Crecto::Model.class)
Sourceforeign_key_value_for_association(association : Symbol, item)
Sourcefrom_rs(__temp_220 : DB::ResultSet)
klass_for_association(association : Symbol)
Empty association methods Implementations are in the setup_association macro
nullify_associations
Sourceset_value_for_association(association : Symbol, item, items)
Sourcethrough_key_for_association(association : Symbol) : Symbol | Nil
Sourceupdated_at_field
Sourceuse_primary_key?
SourceValidates generic block against an instance of the class
Instance methods
cast(attributes : NamedTuple, whitelist : Tuple = attributes.keys)
cast(attributes : Hash(Symbol, T), whitelist : Array(Symbol) = attributes.keys) forall T
cast(attributes : Hash(String, T), whitelist : Array(String) = attributes.keys) forall T
cast
Empty instance methods for mass assignment Implementations are in the Schema.setup macro
cast!(attributes : NamedTuple)
Sourcecreated_at
created_at=(_created_at : Time | Nil)
created_at_to_now
created_at_value
description
description!
description=(_description : String | Nil)
get_changeset
Sourceid
id=(_id : Int32 | Nil)
initial_values
Instance properties
initial_values=(initial_values : Hash(Symbol, DbValue) | Nil)
Instance properties
job
job!
job=(_job : String | Nil)
job_id
job_id!
Builds fields' cast typed method
job_id=(_job_id : Int32 | Nil)
pkey_value
Returns the value of the primary key field
response
response!
response=(_response : String | Nil)
status
status!
status=(_status : String | Nil)
to_query_hash(include_virtual = false)
Builds a hash from all CRECTO_FIELDS defined
update_from_hash(hash : Hash(String, DbValue))
update_primary_key(val)
updated_at
updated_at=(_updated_at : Time | Nil)
updated_at_to_now
updated_at_value