Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
PlaceOS::Model::Playlist::ItemSchedule
Inherits PlaceOS::Model::History::Tracked < PlaceOS::Model::Timestamps < PlaceOS::Model::ModelBase < PlaceOS::Model::Associations < Neuroplastic < PgORM::Base < PgORM::Validators < PgORM::Table < PgORM::Persistence < PgORM::Associations < ActiveModel::Callbacks < ActiveModel::Validation < ActiveModel::Model < DB::Mappable < DB::Serializable < YAML::Serializable < JSON::Serializable < Reference < Object
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Constants
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
macro level key => type
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Constructors
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
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">
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Initialize PlaceOS::Model::Playlist::ItemSchedule from HTTP::Params.
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.
Class methods
Returns all attribute keys.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
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.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Instance methods
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
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
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Assign each field from JSON if field exists in JSON and has changed in model
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Uses the YAML parser as JSON is valid YAML
Returns a Hash of all attribute values
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.
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.
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.
Returns a NamedTuple of all attribute values.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
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.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Serialize the set of changed attributes to YAML.
Serialize the set of changed attributes to YAML.
Returns a Hash of changed attributes, mapping each to a {previous, current} tuple.
Serialize changed attributes to JSON as {"attribute": [previous, current]}.
Values are serialized as in to_json, applying any attribute converters.
Serialize changed attributes to JSON as {"attribute": [previous, current]}.
Values are serialized as in to_json, applying any attribute converters.
Serialize changed attributes to JSON as {"attribute": [previous, current]}.
Values are serialized as in to_json, applying any attribute converters.
Reset changes for all attributes.
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.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
created_at's default value
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Include created_at in the set of changed attributes, whether it has changed or not.
Overrides the action recorded by the next change, e.g. approve
Overrides the action recorded by the next change, e.g. approve
schedules are owned by their distribution playlist, so changes are also found under the playlist (alongside its approved revisions)
Request details recorded with changes to this record, defaults to
History.current_metadata
Request details recorded with changes to this record, defaults to
History.current_metadata
id getter
id setter
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
id's default value
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Include id in the set of changed attributes, whether it has changed or not.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
item_id getter
item_id setter
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
item_id's default value
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Include item_id in the set of changed attributes, whether it has changed or not.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
playlist_id getter
playlist_id setter
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
playlist_id's default value
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Include playlist_id in the set of changed attributes, whether it has changed or not.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Reset each attribute to their previous values and clears all changes.
schedules getter
schedules 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.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
when this item should play — at least one schedule is required, and each schedule must validate. Stored as a JSONB array. Not indexed in elastic.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Include schedules in the set of changed attributes, whether it has changed or not.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
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.
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
updated_at's default value
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Wraps a single Playlist::Item with its own set of schedules. Used by "distribution" playlists, where each media item is scheduled individually rather than the whole playlist sharing one schedule. Owned 1:1 by the distribution playlist (removed via ON DELETE CASCADE when either the playlist or the underlying item is deleted).
Include updated_at in the set of changed attributes, whether it has changed or not.
Validate that all non-nillable fields have values.