junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
PlaceOS::Model::SignageTemplate::SystemTemplate
Inherits PgORM::Timestamps < 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
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Constants
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
macro level key => type
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Constructors
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
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">
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
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.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Instance methods
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
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
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Assign each field from JSON if field exists in JSON and has changed in model
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Uses the YAML parser as JSON is valid YAML
Returns a Hash of all attribute values
Returns a NamedTuple of all attribute values.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
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.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Serialize the set of changed attributes to YAML.
Serialize the set of changed attributes to YAML.
Reset changes for all attributes.
control_system_id getter
control_system_id setter
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Include control_system_id in the set of changed attributes, whether it has changed or not.
created_at getter
Setters
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.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
created_at's default value
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Include created_at in the set of changed attributes, whether it has changed or not.
id getter
id setter
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
id's default value
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Include id in the set of changed attributes, whether it has changed or not.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Reset each attribute to their previous values and clears all changes.
schedule getter
schedule setter
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
when the template applies; nil means this is the default template
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Include schedule in the set of changed attributes, whether it has changed or not.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
template_id getter
template_id 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.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Include template_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.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
updated_at's default value
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Include updated_at in the set of changed attributes, whether it has changed or not.
Validate that all non-nillable fields have values.
zone_id getter
zone_id setter
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
junction attaching a SignageTemplate to a ControlSystem or a Zone
(exactly one of the two). A row with a schedule shows the template
during that schedule; a row without one is the default template for the
pairing (at most one, enforced by a partial unique index). Surrogate
UUID pk as the same template may be attached to the same system or zone
multiple times with different schedules.
Include zone_id in the set of changed attributes, whether it has changed or not.