Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
PlaceOS::Model::Guest
Inherits PlaceOS::Model::Timestamps < PlaceOS::Model::Scope < PlaceOS::Model::Associations < PlaceOS::Model::ModelWithAutoKey < Neuroplastic < PgORM::Base < PgORM::Validators < PgORM::Table < PgORM::Persistence < PgORM::Associations < ActiveModel::Callbacks < ActiveModel::Validation < ActiveModel::Model < DB::Mappable < DB::Serializable < YAML::Serializable < JSON::Serializable < Reference < Object
Constants
macro level key => type
Constructors
Deserializes the given JSON in string_or_io into
an instance of self, assuming the JSON consists
of an JSON object with key root, and whose value is
the value to deserialize. Will not deserialise from
fields with mass_assign: false
class User < ActiveModel::Model
attribute name : String
attribute google_id : UUID, mass_assign: false
end
User.from_json(%({"main": {"name": "Jason", "google_id": "f6f70bfb-c882-446d-8758-7ce47db39620"}}), root: "main") # => #<User:0x103131b20 @name="Jason">
Serialize from a trusted JSON source
Serialize from a trusted YAML source
Initialize PlaceOS::Model::Guest from HTTP::Params.
Class methods
Returns all attribute keys.
Changefeed at row (if id passed) or whole table level.
Returns a ChangeFeed instance which can be used to invoke async callbacks via on or
use blocking Iterator via each method.
Instance methods
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
Generate code to apply default values
Assign to multiple attributes.
Assign to multiple attributes via HTTP::Params.
Assign to multiple attributes from a model object
Assign each field from JSON if field exists in JSON and has changed in model
Uses the YAML parser as JSON is valid YAML
Returns a Hash of all attribute values
Returns a NamedTuple of all attribute values.
banned getter
banned setter
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include banned in the set of changed attributes, whether it has changed or not.
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
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
booking setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
booking_rep setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include booking_rep in the set of changed attributes, whether it has changed or not.
Include booking in the set of changed attributes, whether it has changed or not.
Check if any attributes have changed.
Returns a Hash with all changed attributes.
Serialize the set of changed attributes to JSON.
Serialize the set of changed attributes to JSON.
Serialize the set of changed attributes to YAML.
Serialize the set of changed attributes to YAML.
Accessors for attributes without JSON mapping
checked_in setter
Accessors for attributes without JSON mapping
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include checked_in in the set of changed attributes, whether it has changed or not.
Reset changes for all attributes.
created_at getter
created_at setter
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
created_at's default value
Include created_at in the set of changed attributes, whether it has changed or not.
dangerous getter
dangerous setter
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include dangerous in the set of changed attributes, whether it has changed or not.
email getter
Setters
email setter
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include email in the set of changed attributes, whether it has changed or not.
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
event setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
event_metadata setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include event_metadata in the set of changed attributes, whether it has changed or not.
Include event in the set of changed attributes, whether it has changed or not.
extension_data getter
extension_data setter
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include extension_data in the set of changed attributes, whether it has changed or not.
id getter
id setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
id's default value
Include id in the set of changed attributes, whether it has changed or not.
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
name getter
name setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include name in the set of changed attributes, whether it has changed or not.
notes getter
notes setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include notes in the set of changed attributes, whether it has changed or not.
organisation getter
organisation setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include organisation in the set of changed attributes, whether it has changed or not.
Returns a Hash of all attributes that can be persisted.
phone getter
phone setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include phone in the set of changed attributes, whether it has changed or not.
photo getter
photo setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include photo in the set of changed attributes, whether it has changed or not.
preferred_name getter
preferred_name setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include preferred_name in the set of changed attributes, whether it has changed or not.
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Reset each attribute to their previous values and clears all changes.
searchable getter
searchable setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include searchable in the set of changed attributes, whether it has changed or not.
tenant_id getter
tenant_id setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
tenant_id's default value
Include tenant_id in the set of changed attributes, whether it has changed or not.
updated_at getter
updated_at setter
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
updated_at's default value
Include updated_at in the set of changed attributes, whether it has changed or not.
Validate that all non-nillable fields have values.
NOTE: use getter / getter! (not property / property!) so that the
setter defined later in __create_initializer__ is the only setter on
the field. Crystal's overload resolution silently fails to replace a
property-defined setter with one of identical signature for generic
types (e.g. Set(String)?, Array(String)?, String | Array(String)),
although it does work for non-generic ones like String?. Defining the
setter only once via __create_initializer__ ensures change tracking,
sanitization, and custom setter blocks run uniformly across all types.
visit_expected setter
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include visit_expected in the set of changed attributes, whether it has changed or not.