class PlaceOS::Model::SignageTemplate

Overview

positions widget plugins over a signage display, changing its layout. Attached to displays via SignageTemplate::SystemTemplate.

Included Modules

Defined in:

placeos-models/signage_template.cr
placeos-models/signage_template/layout.cr

Constant Summary

CALLBACKS = {before_save: [do if (__temp_1440 = @authority) && __temp_1440.new_record? __temp_1440.save self.authority_id = __temp_1440.id.not_nil! end end, do if (__temp_1441 = @background_item) && __temp_1441.new_record? __temp_1441.save self.background_item_id = __temp_1441.id.not_nil! end end, do if (__temp_1447 = @live_template) && __temp_1447.new_record? __temp_1447.save self.live_template_id = __temp_1447.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, :__record_history_destroy__] of Nil}

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).

Log = ::Log.for(self)
PRIMARY_KEY_TYPES = {:id => UUID} of Nil => Nil

macro level key => type

PRIMARY_KEYS = [{:id}]

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module PlaceOS::Model::History::Tracked

change_history change_history, history_correlation_id : String | Nil history_correlation_id, history_resource_id : String history_resource_id

Macros inherited from module PlaceOS::Model::History::Tracked

history_ignore(*fields) history_ignore, history_redact(*fields) history_redact

Constructor Detail

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

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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 #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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 #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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, name : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, description : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, tags : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, authority_id : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, background_item_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, layouts : Array(PlaceOS::Model::SignageTemplate::Layout) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, full_screen_takeover : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, merge : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approval_requested : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, requested_by_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approved : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approved_by_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approved_by_name : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approved_by_email : PlaceOS::Model::Email | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, live_template_id : UUID | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new) #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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

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


def self.undelete(resource_id : String) : self #

Recreates a deleted record from its latest delete entry, keeping its id.

Records removed alongside it (cascading deletes) are not restored and redacted fields are left at their defaults. Raises if there is no delete entry or the record can't be saved, e.g. if it already exists.


[View source]

Class Method Detail

def self.attributes : Array(Symbol) #

Returns all attribute keys.


def self.by_authority_id(id) #

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

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

[View source]
def self.change_history(resource_id : String) #

Entries recorded for the resource, newest first


[View source]
def self.changefeed_ignored_update_columns : Array(String) | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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.elastic #

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

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def self.history_ignored : Array(String) #

Fields not recorded, changes to only these fields are not recorded at all


[View source]
def self.history_redacted : Array(String) #

Fields whose values are never recorded


[View source]
def self.on_error(err : Exception | IO::Error) #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def self.primary_key #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


[View source]
def self.table_name #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


Instance Method Detail

def after_create #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def after_destroy #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def after_initialize(trusted : Bool) #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def after_save #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def after_update #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def apply_defaults #

Generate code to apply default values


def approval_requested : Bool #

def approval_requested=(value : Bool) #

def approval_requested? : Bool | 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 approval_requested_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approval_requested_change : Tuple(Bool | Nil, Bool | Nil) | Nil #

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


def approval_requested_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approval_requested_default : Bool #

#approval_requested's default value


[View source]
def approval_requested_present? : Bool #

def approval_requested_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approval_requested_was : Bool | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approval_requested_will_change! : Nil #

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


def approve_draft!(user_model_who_approved : User) : SignageTemplate #

promotes this draft onto the approved template it references: copies the display fields, records the approver on the live template and removes the draft — all in a single transaction


[View source]
def approved : Bool #

#approved getter


def approved=(value : Bool) #

#approved setter


def approved? : Bool | 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 approved_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_email : PlaceOS::Model::Email | Nil #

def approved_by_email=(value : PlaceOS::Model::Email | Nil) #

def approved_by_email_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_email_change : Tuple(PlaceOS::Model::Email | Nil | Nil, PlaceOS::Model::Email | Nil | Nil) | Nil #

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


def approved_by_email_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_email_default : PlaceOS::Model::Email | Nil #

#approved_by_email's default value


[View source]
def approved_by_email_present? : Bool #

def approved_by_email_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_email_was : PlaceOS::Model::Email | Nil | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_email_will_change! : Nil #

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


def approved_by_id : String | Nil #

def approved_by_id=(value : String | Nil) #

def approved_by_id_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_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 approved_by_id_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_id_default : String | Nil #

#approved_by_id's default value


[View source]
def approved_by_id_present? : Bool #

def approved_by_id_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_id_was : String | Nil | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_id_will_change! : Nil #

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


def approved_by_name : String | Nil #

def approved_by_name=(value : String | Nil) #

def approved_by_name_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_name_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 approved_by_name_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_name_default : String | Nil #

#approved_by_name's default value


[View source]
def approved_by_name_present? : Bool #

def approved_by_name_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_name_was : String | Nil | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_by_name_will_change! : Nil #

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


def approved_change : Tuple(Bool | Nil, Bool | Nil) | Nil #

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


def approved_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_default : Bool #

#approved's default value


[View source]
def approved_present? : Bool #

def approved_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_was : Bool | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def approved_will_change! : Nil #

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


def approver=(user) #

[View source]
def assign_attributes(created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing, id : UUID | Missing = Missing, name : String | Missing = Missing, description : String | Nil | Missing = Missing, tags : Array(String) | Missing = Missing, authority_id : String | Missing = Missing, background_item_id : String | Nil | Missing = Missing, layouts : Array(PlaceOS::Model::SignageTemplate::Layout) | Missing = Missing, full_screen_takeover : Bool | Missing = Missing, merge : Bool | Missing = Missing, approval_requested : Bool | Missing = Missing, requested_by_id : String | Nil | Missing = Missing, approved : Bool | Missing = Missing, approved_by_id : String | Nil | Missing = Missing, approved_by_name : String | Nil | Missing = Missing, approved_by_email : PlaceOS::Model::Email | Nil | Missing = Missing, live_template_id : UUID | 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) #

Assign to multiple attributes from a model object


def assign_attributes_from_json(json, root : String) #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def assign_attributes_from_json(json) #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def assign_attributes_from_trusted_json(json, root : String) #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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) #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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_json(io : IO) : Nil #

Serialize attributes to JSON, without any other properties to_json may include, as .from_json expects them.

Values are serialized as in to_json, applying any attribute converters.


def attributes_json(json : JSON::Builder) : Nil #

Serialize attributes to JSON, without any other properties to_json may include, as .from_json expects them.

Values are serialized as in to_json, applying any attribute converters.


def attributes_json : String #

Serialize attributes to JSON, without any other properties to_json may include, as .from_json expects them.

Values are serialized as in to_json, applying any attribute converters.


def attributes_tuple #

Returns a NamedTuple of all attribute values.


def authority : PlaceOS::Model::Authority #

[View source]
def authority! : PlaceOS::Model::Authority #

[View source]

[View source]
def authority? : PlaceOS::Model::Authority | Nil #

[View source]
def authority_id : String #

#authority_id getter


def authority_id=(value : String) #

#authority_id setter


def authority_id? : String | 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 authority_id_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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

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


def authority_id_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def authority_id_default : String #

#authority_id's default value


[View source]
def authority_id_present? : Bool #

def authority_id_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def authority_id_was : String | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def authority_id_will_change! : Nil #

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


def background_item : PlaceOS::Model::Playlist::Item #

[View source]
def background_item! : PlaceOS::Model::Playlist::Item #

[View source]

[View source]
def background_item? : PlaceOS::Model::Playlist::Item | Nil #

[View source]
def background_item_id : String | Nil #

def background_item_id=(value : String | Nil) #

def background_item_id_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def background_item_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 background_item_id_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def background_item_id_default : String | Nil #

#background_item_id's default value


[View source]
def background_item_id_present? : Bool #

optional media item rendered behind the widgets (cleared at the DB level if the item is deleted: ON DELETE SET NULL)


def background_item_id_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def background_item_id_was : String | Nil | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def background_item_id_will_change! : Nil #

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


def before_create #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def before_destroy #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def before_save #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def before_update #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def build_authority(**attributes) : PlaceOS::Model::Authority #

[View source]
def build_background_item(**attributes) : PlaceOS::Model::Playlist::Item #

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

[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 #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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 changes #

Returns a Hash of changed attributes, mapping each to a {previous, current} tuple.


def changes_json(io : IO) : Nil #

Serialize changed attributes to JSON as {"attribute": [previous, current]}.

Values are serialized as in to_json, applying any attribute converters.


def changes_json(json : JSON::Builder) : Nil #

Serialize changed attributes to JSON as {"attribute": [previous, current]}.

Values are serialized as in to_json, applying any attribute converters.


def changes_json : String #

Serialize changed attributes to JSON as {"attribute": [previous, current]}.

Values are serialized as in to_json, applying any attribute converters.


def clear_changes_information #

Reset changes for all attributes.


def create_authority(**attributes) : PlaceOS::Model::Authority #

[View source]
def create_authority!(**attributes) : PlaceOS::Model::Authority #

[View source]
def create_background_item(**attributes) : PlaceOS::Model::Playlist::Item #

[View source]
def create_background_item!(**attributes) : PlaceOS::Model::Playlist::Item #

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

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

[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 #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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 #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def created_at_default : Time #

#created_at's default value


def created_at_present? : Bool #

def created_at_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def created_at_was : Time | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def created_at_will_change! : Nil #

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


def description : String | Nil #

#description getter


def description=(value : String | Nil) #

#description setter


def description_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def description_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 description_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def description_default : String | Nil #

#description's default value


[View source]
def description_present? : Bool #

def description_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def description_was : String | Nil | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def description_will_change! : Nil #

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


def draft? : Bool #

[View source]
def full_screen_takeover : Bool #

def full_screen_takeover=(value : Bool) #

def full_screen_takeover? : Bool | 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 full_screen_takeover_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def full_screen_takeover_change : Tuple(Bool | Nil, Bool | Nil) | Nil #

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


def full_screen_takeover_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def full_screen_takeover_default : Bool #

#full_screen_takeover's default value


[View source]
def full_screen_takeover_present? : Bool #

def full_screen_takeover_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def full_screen_takeover_was : Bool | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def full_screen_takeover_will_change! : Nil #

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


def history_action : String | Nil #

Overrides the action recorded by the next change, e.g. approve


def history_action=(history_action : String | Nil) #

Overrides the action recorded by the next change, e.g. approve


def history_metadata : PlaceOS::Model::History::Metadata | Nil #

Request details recorded with changes to this record, defaults to History.current_metadata


def history_metadata=(history_metadata : PlaceOS::Model::History::Metadata | Nil) #

Request details recorded with changes to this record, defaults to History.current_metadata


def id : UUID #

#id getter


def id=(value : UUID) #

#id setter


def id? #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def id_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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 #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def id_default : UUID #

#id's default value


def id_present? : Bool #

def id_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def id_was : UUID | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def id_will_change! : Nil #

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


def invoke_props #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


#layouts getter


def layouts=(value : Array(PlaceOS::Model::SignageTemplate::Layout)) #

#layouts setter


def layouts? : Array(PlaceOS::Model::SignageTemplate::Layout) | 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 layouts_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def layouts_change : Tuple(Array(PlaceOS::Model::SignageTemplate::Layout) | Nil, Array(PlaceOS::Model::SignageTemplate::Layout) | Nil) | Nil #

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


def layouts_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def layouts_default : Array(Layout) #

#layouts's default value


[View source]
def layouts_present? : Bool #

widget placements, stored as a JSONB array. Not indexed in elastic.


def layouts_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def layouts_was : Array(PlaceOS::Model::SignageTemplate::Layout) | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def layouts_will_change! : Nil #

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


def live_template : PlaceOS::Model::SignageTemplate #

[View source]
def live_template! : PlaceOS::Model::SignageTemplate #

[View source]

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

[View source]
def live_template_id : UUID | Nil #

def live_template_id=(value : UUID | Nil) #

def live_template_id_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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

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


def live_template_id_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def live_template_id_default : UUID | Nil #

#live_template_id's default value


[View source]
def live_template_id_present? : Bool #

approved templates should not be edited in place, so drafts are separate rows referencing the approved parent they were copied from. Drafts are removed at the DB level when the parent is deleted (ON DELETE CASCADE)


def live_template_id_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def live_template_id_was : UUID | Nil | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def live_template_id_will_change! : Nil #

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


def merge : Bool #

#merge getter


def merge=(value : Bool) #

#merge setter


def merge? : Bool | 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 merge_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def merge_change : Tuple(Bool | Nil, Bool | Nil) | Nil #

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


def merge_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def merge_default : Bool #

#merge's default value


[View source]
def merge_present? : Bool #

def merge_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def merge_was : Bool | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def merge_will_change! : Nil #

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


def name : String #

#name getter


def name=(value : String) #

#name setter


def name? : String | 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 name_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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

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


def name_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def name_default : String #

#name's default value


[View source]
def name_present? : Bool #

def name_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def name_was : String | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def name_will_change! : Nil #

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


def persistent_attributes #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def primary_key #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


[View source]
def primary_key_hash #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def reload_authority : PlaceOS::Model::Authority #

[View source]
def reload_authority? : PlaceOS::Model::Authority | Nil #

[View source]
def reload_background_item : PlaceOS::Model::Playlist::Item #

[View source]
def reload_background_item? : PlaceOS::Model::Playlist::Item | Nil #

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

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

[View source]
def requested_by_id : String | Nil #

def requested_by_id=(value : String | Nil) #

def requested_by_id_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def requested_by_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 requested_by_id_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def requested_by_id_default : String | Nil #

#requested_by_id's default value


[View source]
def requested_by_id_present? : Bool #

def requested_by_id_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def requested_by_id_was : String | Nil | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def requested_by_id_will_change! : Nil #

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


def restore_attributes #

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


def system_templates #

[View source]
def systems #

[View source]
def table_name #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def tags : Array(String) #

#tags getter


def tags=(value : Array(String)) #

#tags setter


def tags? : Array(String) | 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 tags_assigned? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def tags_change : Tuple(Array(String) | Nil, Array(String) | Nil) | Nil #

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


def tags_changed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def tags_default : Array(String) #

#tags's default value


[View source]
def tags_present? : Bool #

def tags_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def tags_was : Array(String) | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def tags_will_change! : Nil #

Include #tags 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 #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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 #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def updated_at_default : Time #

#updated_at's default value


def updated_at_present? : Bool #

def updated_at_removed? : Bool #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


def updated_at_was : Time | Nil #

forward declare so this file can be required before signage_template.cr finishes defining the parent class (the attribute layouts : Array(Layout) line needs Layout resolved at macro-expansion time).


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 zones #

[View source]