Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
abstract class PlaceOS::Model::ModelWithAutoKey
- PlaceOS::Model::ModelWithAutoKey
- PgORM::Base
- ActiveModel::Model
- Reference
- Object
Overview
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Included Modules
- Neuroplastic
Direct Known Subclasses
- PlaceOS::Model::Attendee
- PlaceOS::Model::Booking
- PlaceOS::Model::BookingInstance
- PlaceOS::Model::ChatMessage
- PlaceOS::Model::DoorkeeperApplication
- PlaceOS::Model::EventMetadata
- PlaceOS::Model::Guest
- PlaceOS::Model::Survey
- PlaceOS::Model::Survey::Answer
- PlaceOS::Model::Survey::Invitation
- PlaceOS::Model::Survey::Question
- PlaceOS::Model::Tenant
Defined in:
placeos-models/base/model.crConstant Summary
-
CALLBACKS =
{before_save: [] of Nil, after_save: [] of Nil, before_create: [] of Nil, after_create: [] of Nil, before_update: [] of Nil, after_update: [] of Nil, before_destroy: [] of Nil, after_destroy: [] of Nil}
-
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Constructors
-
.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
.new(pull : JSON::PullParser)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
.new(rs : DB::ResultSet)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Class Method Summary
-
.attributes : Array(Symbol)
Returns all attribute keys.
-
.auto_generate_id : Bool
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
.from_rs(rs : DB::ResultSet)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
.primary_key : Symbol
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Instance Method Summary
-
#after_create
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#after_destroy
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#after_save
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#after_update
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#apply_defaults
Generate code to apply default values
-
#assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Assign to mulitple attributes via
HTTP::Params
. -
#assign_attributes(model : PlaceOS::Model::ModelWithAutoKey)
Assign to multiple attributes from a model object
-
#assign_attributes
Assign to multiple attributes.
-
#attributes
Returns a
Hash
of all attribute values -
#attributes_tuple
Returns a
NamedTuple
of all attribute values. -
#before_create
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#before_destroy
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#before_save
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#before_update
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#invoke_props
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#persistent_attributes
Returns a
Hash
of all attributes that can be persisted. -
#run_create_callbacks(&)
Wrap a block with callbacks for the appropriate crud operation
-
#run_destroy_callbacks(&)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#run_save_callbacks(&)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#run_update_callbacks(&)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Constructor Detail
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Class Method Detail
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Instance Method Detail
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Assign to mulitple attributes via HTTP::Params
.
Assign to multiple attributes from a model object
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk