class PlaceOS::Model::SignageTemplate::SystemTemplate

Overview

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.

Included Modules

Defined in:

placeos-models/signage_template/system_template.cr

Constant Summary

CALLBACKS = {before_save: [do if (__temp_1452 = @control_system) && __temp_1452.new_record? __temp_1452.save self.control_system_id = __temp_1452.id.not_nil! end end, do if (__temp_1453 = @zone) && __temp_1453.new_record? __temp_1453.save self.zone_id = __temp_1453.id.not_nil! end end, do if (__temp_1455 = @template) && __temp_1455.new_record? __temp_1455.save self.template_id = __temp_1455.id.not_nil! end end] of Nil, after_save: [] of Nil, before_create: [do self.created_at = self.updated_at = Time.utc end] of Nil, after_create: [] of Nil, before_update: [do self.updated_at = Time.utc end] of Nil, after_update: [] of Nil, before_destroy: [] of Nil, after_destroy: [do end, do end, do end] of Nil}

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.

PRIMARY_KEY_TYPES = {:id => UUID} of Nil => Nil

macro level key => type

PRIMARY_KEYS = [{:id}]

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

Class Method Summary

Instance Method Summary

Constructor Detail

def self.from_json(string_or_io : String | IO, trusted : Bool = false) : self #

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.


def self.from_json(string_or_io : String | IO, root : String, trusted : Bool = false) : self #

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">

def self.from_trusted_json(string_or_io : String | IO, root : String) : self #

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.


def self.from_trusted_json(string_or_io : String | IO) : self #

Serialize from a trusted JSON source


def self.from_trusted_yaml(string_or_io : String | IO) : self #

Serialize from a trusted YAML source


def self.from_yaml(string_or_io : String | IO, trusted : Bool = false) : self #

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.


def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

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.


[View source]
def self.new(pull : JSON::PullParser) #

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.


[View source]
def self.new(rs : DB::ResultSet) #

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.


def self.new(created_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, updated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : UUID | ActiveModel::Model::None = ::ActiveModel::Model::None.new, control_system_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, zone_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, template_id : UUID | ActiveModel::Model::None = ::ActiveModel::Model::None.new, schedule : PlaceOS::Model::Playlist::Schedule | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new) #

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.


def self.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String)) #

Initialize PlaceOS::Model::SignageTemplate::SystemTemplate from HTTP::Params.


Class Method Detail

def self.attributes : Array(Symbol) #

Returns all attribute keys.


def self.by_control_system_id(id) #

[View source]
def self.by_template_id(id) #

[View source]
def self.by_zone_id(id) #

[View source]
def self.changes(id : UUID | Nil = nil) : ChangeFeed #

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.


def self.from_rs(__temp_2600 : DB::ResultSet) #

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.


def self.on_error(err : Exception | IO::Error) #

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.


def self.primary_key #

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.


[View source]
def self.table_name #

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 Method Detail

def after_create #

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.


def after_destroy #

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.


def after_initialize(trusted : Bool) #

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.


def after_save #

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.


def after_update #

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.


def apply_defaults #

Generate code to apply default values


def assign_attributes(created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing, id : UUID | Missing = Missing, control_system_id : String | Nil | Missing = Missing, zone_id : String | Nil | Missing = Missing, template_id : UUID | Missing = Missing, schedule : PlaceOS::Model::Playlist::Schedule | Nil | Missing = Missing) #

Assign to multiple attributes.


def assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String)) #

Assign to multiple attributes via HTTP::Params.


def assign_attributes(model : PlaceOS::Model::SignageTemplate::SystemTemplate) #

Assign to multiple attributes from a model object


def assign_attributes_from_json(json, root : String) #

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.


def assign_attributes_from_json(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.


def assign_attributes_from_trusted_json(json, root : String) #

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.


def assign_attributes_from_trusted_json(json) #

Assign each field from JSON if field exists in JSON and has changed in model


def assign_attributes_from_trusted_yaml(yaml) #

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.


def assign_attributes_from_yaml(yaml) #

Uses the YAML parser as JSON is valid YAML


def attributes #

Returns a Hash of all attribute values


def attributes_tuple #

Returns a NamedTuple of all attribute values.


def before_create #

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.


def before_destroy #

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.


def before_save #

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.


def before_update #

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.


def build_control_system(**attributes) : PlaceOS::Model::ControlSystem #

[View source]
def build_template(**attributes) : PlaceOS::Model::SignageTemplate #

[View source]
def build_zone(**attributes) : PlaceOS::Model::Zone #

[View source]
def changed? #

Check if any attributes have changed.


def changed_attributes #

Returns a Hash with all changed attributes.


def changed_json(io : IO) : Nil #

Serialize the set of changed attributes to JSON.


def changed_json : String #

Serialize the set of changed attributes to JSON.


def changed_persist_attributes #

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.


def changed_yaml(io : IO) : Nil #

Serialize the set of changed attributes to YAML.


def changed_yaml : String #

Serialize the set of changed attributes to YAML.


def clear_changes_information #

Reset changes for all attributes.


def control_system : PlaceOS::Model::ControlSystem #

[View source]
def control_system! : PlaceOS::Model::ControlSystem #

[View source]

[View source]
def control_system? : PlaceOS::Model::ControlSystem | Nil #

[View source]
def control_system_id : String | Nil #

def control_system_id=(value : String | Nil) #

def control_system_id_assigned? : Bool #

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.


def control_system_id_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def control_system_id_changed? : Bool #

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.


def control_system_id_default : String | Nil #

#control_system_id's default value


[View source]
def control_system_id_present? : Bool #

def control_system_id_removed? : Bool #

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.


def control_system_id_was : String | Nil | Nil #

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.


def control_system_id_will_change! : Nil #

Include #control_system_id in the set of changed attributes, whether it has changed or not.


def create_control_system(**attributes) : PlaceOS::Model::ControlSystem #

[View source]
def create_control_system!(**attributes) : PlaceOS::Model::ControlSystem #

[View source]
def create_template(**attributes) : PlaceOS::Model::SignageTemplate #

[View source]
def create_template!(**attributes) : PlaceOS::Model::SignageTemplate #

[View source]
def create_zone(**attributes) : PlaceOS::Model::Zone #

[View source]
def create_zone!(**attributes) : PlaceOS::Model::Zone #

[View source]
def created_at : Time #

#created_at getter


def created_at=(value : Time) #

Setters #created_at setter


def created_at? : Time | Nil #

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.


def created_at_assigned? : Bool #

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.


def created_at_change : Tuple(Time | Nil, Time | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def created_at_changed? : Bool #

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.


def created_at_default : Time #

#created_at's default value


def created_at_present? : Bool #

def created_at_removed? : Bool #

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.


def created_at_was : Time | Nil #

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.


def created_at_will_change! : Nil #

Include #created_at in the set of changed attributes, whether it has changed or not.


def default? : Bool #

[View source]
def id : UUID #

#id getter


def id=(value : UUID) #

#id setter


def id? #

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.


def id_assigned? : Bool #

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.


def id_change : Tuple(UUID | Nil, UUID | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def id_changed? : Bool #

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.


def id_default : UUID #

#id's default value


def id_present? : Bool #

def id_removed? : Bool #

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.


def id_was : UUID | Nil #

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.


def id_will_change! : Nil #

Include #id in the set of changed attributes, whether it has changed or not.


def invoke_props #

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.


def persistent_attributes #

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.


def primary_key #

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.


[View source]
def primary_key_hash #

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.


def reload_control_system : PlaceOS::Model::ControlSystem #

[View source]
def reload_control_system? : PlaceOS::Model::ControlSystem | Nil #

[View source]
def reload_template : PlaceOS::Model::SignageTemplate #

[View source]
def reload_template? : PlaceOS::Model::SignageTemplate | Nil #

[View source]
def reload_zone : PlaceOS::Model::Zone #

[View source]
def reload_zone? : PlaceOS::Model::Zone | Nil #

[View source]
def restore_attributes #

Reset each attribute to their previous values and clears all changes.


def schedule : PlaceOS::Model::Playlist::Schedule | Nil #

#schedule getter


def schedule=(value : PlaceOS::Model::Playlist::Schedule | Nil) #

#schedule setter


def schedule_assigned? : Bool #

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.


def schedule_change : Tuple(PlaceOS::Model::Playlist::Schedule | Nil | Nil, PlaceOS::Model::Playlist::Schedule | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def schedule_changed? : Bool #

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.


def schedule_default : Playlist::Schedule | Nil #

#schedule's default value


[View source]
def schedule_present? : Bool #

when the template applies; nil means this is the default template


def schedule_removed? : Bool #

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.


def schedule_was : PlaceOS::Model::Playlist::Schedule | Nil | Nil #

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.


def schedule_will_change! : Nil #

Include #schedule in the set of changed attributes, whether it has changed or not.


def table_name #

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.



[View source]

[View source]

[View source]
def template? : PlaceOS::Model::SignageTemplate | Nil #

[View source]
def template_id : UUID #

#template_id getter


def template_id=(value : UUID) #

#template_id setter


def template_id? : UUID | Nil #

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.


def template_id_assigned? : Bool #

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.


def template_id_change : Tuple(UUID | Nil, UUID | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def template_id_changed? : Bool #

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.


def template_id_default : UUID #

#template_id's default value


[View source]
def template_id_present? : Bool #

def template_id_removed? : Bool #

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.


def template_id_was : UUID | Nil #

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.


def template_id_will_change! : Nil #

Include #template_id in the set of changed attributes, whether it has changed or not.


def updated_at : Time #

#updated_at getter


def updated_at=(value : Time) #

#updated_at setter


def updated_at? : Time | Nil #

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.


def updated_at_assigned? : Bool #

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.


def updated_at_change : Tuple(Time | Nil, Time | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def updated_at_changed? : Bool #

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.


def updated_at_default : Time #

#updated_at's default value


def updated_at_present? : Bool #

def updated_at_removed? : Bool #

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.


def updated_at_was : Time | Nil #

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.


def updated_at_will_change! : Nil #

Include #updated_at in the set of changed attributes, whether it has changed or not.


def validate_nilability #

Validate that all non-nillable fields have values.


def zone : PlaceOS::Model::Zone #

[View source]
def zone! : PlaceOS::Model::Zone #

[View source]

[View source]
def zone? : PlaceOS::Model::Zone | Nil #

[View source]
def zone_id : String | Nil #

#zone_id getter


def zone_id=(value : String | Nil) #

#zone_id setter


def zone_id_assigned? : Bool #

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.


def zone_id_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def zone_id_changed? : Bool #

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.


def zone_id_default : String | Nil #

#zone_id's default value


[View source]
def zone_id_present? : Bool #

def zone_id_removed? : Bool #

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.


def zone_id_was : String | Nil | Nil #

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.


def zone_id_will_change! : Nil #

Include #zone_id in the set of changed attributes, whether it has changed or not.