class

PlaceOS::Model::Playlist

Inherits 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

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

Constants

CALLBACKS = { before_save: [] 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: [] of Nil, }

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

Log = ::Log.for(self)

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

PRIMARY_KEY_TYPES = {:id => (String | Nil)} of Nil => Nil

macro level key => type

PRIMARY_KEYS = [{:id}]

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

Constructors

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

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

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">
from_trusted_json(string_or_io : String | IO, root : String) : self

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

from_trusted_json(string_or_io : String | IO) : self

Serialize from a trusted JSON source

from_trusted_yaml(string_or_io : String | IO) : self

Serialize from a trusted YAML source

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

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

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

Source
new(pull : JSON::PullParser)

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

Source
new(rs : DB::ResultSet)

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

new(created_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, updated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, name : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, description : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, authority_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, orientation : PlaceOS::Model::Playlist::Orientation | ActiveModel::Model::None = ::ActiveModel::Model::None.new, play_count : Int64 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, play_through_count : Int64 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, default_animation : PlaceOS::Model::Playlist::Animation | ActiveModel::Model::None = ::ActiveModel::Model::None.new, random : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, enabled : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, distribution : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, default_duration : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, valid_from : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, valid_until : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, schedules : Array(PlaceOS::Model::Playlist::Schedule) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

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

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

Class methods

attributes

Returns all attribute keys.

by_authority_id(id)

Look up instances of this model dependent on the foreign key

Source
changes(id : String | Nil | 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.

elastic

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

from_rs(__temp_1994 : DB::ResultSet)

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

on_error(err : Exception | IO::Error)

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

primary_key

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

Source
table_name

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

update_counts(metrics : Hash(String, Int32))
Source
update_through_counts(metrics : Hash(String, Int32))
Source

Instance methods

__authority
__authority=(__authority : Authority | Nil)
after_create

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

after_destroy

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

after_initialize(trusted : Bool)

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

after_save

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

after_update

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

apply_defaults

Generate code to apply default values

assign_attributes(created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing, name : String | Missing = Missing, description : String | Missing = Missing, authority_id : String | Nil | Missing = Missing, orientation : PlaceOS::Model::Playlist::Orientation | Missing = Missing, play_count : Int64 | Missing = Missing, play_through_count : Int64 | Missing = Missing, default_animation : PlaceOS::Model::Playlist::Animation | Missing = Missing, random : Bool | Missing = Missing, enabled : Bool | Missing = Missing, distribution : Bool | Missing = Missing, default_duration : Int32 | Missing = Missing, valid_from : Int64 | Nil | Missing = Missing, valid_until : Int64 | Nil | Missing = Missing, schedules : Array(PlaceOS::Model::Playlist::Schedule) | Missing = Missing, id : String | Nil | Missing = Missing)

Assign to multiple attributes.

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

Assign to multiple attributes via HTTP::Params.

assign_attributes(model : PlaceOS::Model::Playlist)

Assign to multiple attributes from a model object

assign_attributes_from_json(json, root : String)

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

assign_attributes_from_json(json)

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

assign_attributes_from_trusted_json(json, root : String)

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

assign_attributes_from_trusted_json(json)

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

assign_attributes_from_trusted_yaml(yaml)

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

assign_attributes_from_yaml(yaml)

Uses the YAML parser as JSON is valid YAML

attributes

Returns a Hash of all attribute values

attributes_tuple

Returns a NamedTuple of all attribute values.

authority

Retrieves the parent relationship

Source
authority!
Source
authority=(parent : Authority)

Sets the parent relationship

Source
authority_id

authority_id getter

authority_id=(value : String | Nil)

authority_id setter

authority_id_assigned?

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

authority_id_change

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

authority_id_changed?

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

authority_id_default

authority_id's default value

authority_id_present?
authority_id_removed?

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

authority_id_was

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

authority_id_will_change!

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

before_create

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

before_destroy

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

before_save

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

before_update

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

changed?

Check if any attributes have changed.

changed_attributes

Returns a Hash with all changed attributes.

changed_json(io : IO) : Nil

Serialize the set of changed attributes to JSON.

changed_json

Serialize the set of changed attributes to JSON.

changed_persist_attributes

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

changed_yaml(io : IO) : Nil

Serialize the set of changed attributes to YAML.

changed_yaml

Serialize the set of changed attributes to YAML.

clear_changes_information

Reset changes for all attributes.

created_at

created_at getter

created_at=(value : Time)

Setters created_at setter

created_at?

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.

created_at_assigned?

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

created_at_change

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

created_at_changed?

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

created_at_default

created_at's default value

created_at_present?
created_at_removed?

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

created_at_was

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

created_at_will_change!

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

default_animation

default_animation getter

default_animation=(value : PlaceOS::Model::Playlist::Animation)

default_animation setter

default_animation?

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.

default_animation_assigned?

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

default_animation_change

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

default_animation_changed?

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

default_animation_default

default_animation's default value

Source
default_animation_present?
default_animation_removed?

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

default_animation_was

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

default_animation_will_change!

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

default_duration

default_duration getter

default_duration=(value : Int32)

default_duration setter

default_duration?

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.

default_duration_assigned?

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

default_duration_change

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

default_duration_changed?

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

default_duration_default

default_duration's default value

Source
default_duration_present?

time in milliseconds

default_duration_removed?

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

default_duration_was

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

default_duration_will_change!

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

description

description getter

description=(value : String)

description setter

description?

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.

description_assigned?

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

description_change

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

description_changed?

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

description_default

description's default value

Source
description_present?
description_removed?

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

description_was

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

description_will_change!

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

distribution

distribution getter

distribution=(value : Bool)

distribution setter

distribution?

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.

distribution_assigned?

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

distribution_change

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

distribution_changed?

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

distribution_default

distribution's default value

Source
distribution_present?

If the playlist is used to manage individually scheduled items then it should be flagged as a distribution playlist each item will have its own schedule (via item_schedule table)

distribution_removed?

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

distribution_was

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

distribution_will_change!

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

enabled

enabled getter

enabled=(value : Bool)

enabled setter

enabled?

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.

enabled_assigned?

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

enabled_change

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

enabled_changed?

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

enabled_default

enabled's default value

Source
enabled_present?
enabled_removed?

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

enabled_was

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

enabled_will_change!

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

id

id getter

id=(value : String | Nil)

id setter

id?

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

id_assigned?

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

id_change

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

id_changed?

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

id_default

id's default value

id_present?

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

id_removed?

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

id_was

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

id_will_change!

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

invoke_props

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

name

name getter

name=(value : String)

name setter

name?

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.

name_assigned?

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

name_change

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

name_changed?

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

name_default

name's default value

Source
name_present?
name_removed?

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

name_was

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

name_will_change!

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

orientation

orientation getter

orientation setter

orientation?

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.

orientation_assigned?

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

orientation_change

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

orientation_changed?

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

orientation_default

orientation's default value

Source
orientation_present?
orientation_removed?

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

orientation_was

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

orientation_will_change!

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

persistent_attributes

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

play_count

play_count getter

play_count=(value : Int64)

play_count setter

play_count?

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.

play_count_assigned?

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

play_count_change

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

play_count_changed?

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

play_count_default

play_count's default value

Source
play_count_present?
play_count_removed?

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

play_count_was

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

play_count_will_change!

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

play_through_count

play_through_count getter

play_through_count=(value : Int64)

play_through_count setter

play_through_count?

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.

play_through_count_assigned?

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

play_through_count_change

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

play_through_count_changed?

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

play_through_count_default

play_through_count's default value

Source
play_through_count_present?
play_through_count_removed?

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

play_through_count_was

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

play_through_count_will_change!

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

primary_key

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

Source
primary_key_hash

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

random

random getter

random=(value : Bool)

random setter

random?

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.

random_assigned?

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

random_change

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

random_changed?

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

random_default

random's default value

Source
random_present?
random_removed?

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

random_was

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

random_will_change!

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

reset_associations
Source
restore_attributes

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

revision
Source
revisions
Source
schedules

schedules getter

schedules setter

schedules?

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.

schedules_assigned?

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

schedules_change

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

schedules_changed?

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

schedules_default

schedules's default value

Source
schedules_present?

when this playlist should play — at least one schedule is required unless a distribution, and each schedule must validate. Stored as a JSONB array.

schedules_removed?

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

schedules_was

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

schedules_will_change!

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

should_present?(now : Time = Time.utc) : Bool
Source
systems
Source
table_name

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

to_items_json(json : JSON::Builder)

Serialize attributes with :items in its serialization_group option

to_items_json(io : IO) : Nil

Serialize attributes with :items in its serialization_group option

to_items_json

Serialize attributes with :items in its serialization_group option

to_items_struct

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

updated_at

updated_at getter

updated_at=(value : Time)

updated_at setter

updated_at?

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.

updated_at_assigned?

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

updated_at_change

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

updated_at_changed?

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

updated_at_default

updated_at's default value

updated_at_present?
updated_at_removed?

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

updated_at_was

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

updated_at_will_change!

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

valid_from

valid_from getter

valid_from=(value : Int64 | Nil)

valid_from setter

valid_from_assigned?

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

valid_from_change

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

valid_from_changed?

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

valid_from_default

valid_from's default value

Source
valid_from_present?

conditions that can determine when a playlist is valid

valid_from_removed?

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

valid_from_was

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

valid_from_will_change!

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

valid_until

valid_until getter

valid_until=(value : Int64 | Nil)

valid_until setter

valid_until_assigned?

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

valid_until_change

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

valid_until_changed?

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

valid_until_default

valid_until's default value

Source
valid_until_present?
valid_until_removed?

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

valid_until_was

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

valid_until_will_change!

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

validate_nilability

Validate that all non-nillable fields have values.

zones
Source

Nested types