class

PlaceOS::Model::Booking

Inherits PlaceOS::Model::Timestamps < PlaceOS::Model::Scope < PlaceOS::Model::Associations < PlaceOS::Model::ModelWithAutoKey < 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

Constants

CALLBACKS = { before_save: [do @user_id || (@user_id = booked_by_id) @user_email || (@user_email = booked_by_email) @user_name || (@user_name = booked_by_name) @email_digest || (@email_digest = user_email.digest) @booked_by_email_digest = booked_by_email.digest @booked_from || (@booked_from = utm_source) @history = current_history if history.size > 3 Log.error do { message: "History contains more than 3 events.", id: id, } end end update_assets survey_trigger end] of Nil, after_save: [] of Nil, before_create: [:set_created, do self.created_at = self.updated_at = Time.utc end] of Nil, after_create: [] of Nil, before_update: [:cleanup_recurring_instances, do if parent? if booking_start_changed? || booking_end_changed? linked_bookings = Booking.where(parent_id: id) clashing = linked_bookings.select do |booking| booking.booking_start = booking_start booking.booking_end = booking_end booking.clashing? end if clashing.empty? else (Booking.where({:id => clashing.map(&.id)})).update_all({:rejected => true, :rejected_at => Time.utc.to_unix}) end Booking.where(parent_id: id).update_all({:booking_start => booking_start, :booking_end => booking_end}) elsif deleted_changed? || deleted_at_changed? Booking.where(parent_id: id).update_all({:deleted => deleted, :deleted_at => deleted_at}) elsif (((((approved_changed? || approved_at_changed?) || rejected_changed?) || rejected_at_changed?) || approver_id_changed?) || approver_name_changed?) || approver_email_changed? Booking.where(parent_id: id).update_all({:approved => approved, :approved_at => approved_at, :rejected => rejected, :rejected_at => rejected_at, :approver_id => approver_id, :approver_name => approver_name, :approver_email => approver_email}) end end end, do if linked? if booking_start_changed? || booking_end_changed? meta = linked_event.not_nil! self.booking_start = meta.event_start self.booking_end = meta.event_end end end end, do self.updated_at = Time.utc end] of Nil, after_update: [] of Nil, before_destroy: [:destroy_attendees] of Nil, after_destroy: [] of Nil, }
DAY_BITS = {Time::DayOfWeek::Sunday => 1, Time::DayOfWeek::Monday => 1 << 1, Time::DayOfWeek::Tuesday => 1 << 2, Time::DayOfWeek::Wednesday => 1 << 3, Time::DayOfWeek::Thursday => 1 << 4, Time::DayOfWeek::Friday => 1 << 5, Time::DayOfWeek::Saturday => 1 << 6}
DEFAULT_LIMIT = 100000
Log = ::Log.for(self)
PRIMARY_KEY_TYPES = {:id => (Int64 | Nil)} of Nil => Nil

macro level key => type

PRIMARY_KEYS = [{:id}]
TRUTHY = {true, "true"}

Constructors

from_json(string_or_io : String | IO, trusted : Bool = false) : 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">
from_trusted_json(string_or_io : String | IO, root : String) : self
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
new(rs : DB::ResultSet)
new(booking_type : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, booking_start : Int64 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, booking_end : Int64 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, timezone : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, asset_id : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, user_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, user_email : PlaceOS::Model::Email | ActiveModel::Model::None = ::ActiveModel::Model::None.new, user_name : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, zones : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, process_state : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, last_changed : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approved : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approved_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, rejected : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, rejected_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approver_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approver_name : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, approver_email : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, department : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, title : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, checked_in : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, checked_in_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, checked_out_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, description : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, deleted : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, deleted_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, booked_by_email : PlaceOS::Model::Email | ActiveModel::Model::None = ::ActiveModel::Model::None.new, booked_by_name : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, booked_from : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, extension_data : JSON::Any | ActiveModel::Model::None = ::ActiveModel::Model::None.new, history : Array(PlaceOS::Model::Booking::History) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, email_digest : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, booked_by_id : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, booked_by_email_digest : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, created : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, parent_id : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, event_id : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, instance : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, utm_source : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, asset_ids : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, images : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, induction : PlaceOS::Model::Booking::Induction | ActiveModel::Model::None = ::ActiveModel::Model::None.new, permission : PlaceOS::Model::Booking::Permission | ActiveModel::Model::None = ::ActiveModel::Model::None.new, recurrence_type : PlaceOS::Model::Booking::Recurrence | ActiveModel::Model::None = ::ActiveModel::Model::None.new, recurrence_days : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, recurrence_nth_of_month : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, recurrence_interval : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, recurrence_end : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, all_day : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, tenant_id : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, created_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, updated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

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

Class methods

attributes

Returns all attribute keys.

booked_between(tenant_id, period_start, period_end)
Source
by_tenant(tenant_id)
Source
by_tenant_id(id)

Look up instances of this model dependent on the foreign key

Source
by_user_id(user_id)
Source
by_user_or_email(user_id_value, user_email_value, include_booked_by, include_open_permission, include_public_permission)
Source
by_user_or_email(user_id_value, user_email_value, include_booked_by)
Source
by_zones(zones)

Bookings have the zones in an array.

In case of multiple zones as input, we return all bookings that have any of the input zones in their zones array

Source
changes(id : Int64 | 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
expand_bookings!(starting : Time, ending : Time, parents : Array(Booking), limit : Int32 = DEFAULT_LIMIT, skip : Int32 = 0, is_checked_out : Bool | Nil = nil, include_deleted : Bool = false) : ExpansionDetails

modifies the array, injecting the recurrences

Source
from_rs(__temp_1827 : DB::ResultSet)
hydrate_parents(bookings : Array(Booking))
Source
is_approved(value)
Source
is_booking_type(booking_type)
Source
is_checked_in(value)
Source
is_created_after(time)
Source
is_created_before(time)
Source
is_department(value)
Source
is_extension_data(value)
Source
is_rejected(value)
Source
is_state(state)
Source
on_error(err : Exception | IO::Error)
primary_key

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

Source
table_name

Instance methods

__guests_rel

NOTE:: not to be used directly, only here for caching

__tenant
__tenant=(__tenant : Tenant | Nil)
after_create

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

after_destroy

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

after_initialize(trusted : Bool)
after_save

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

after_update

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

all_day

all_day getter

all_day=(value : Bool)

all_day setter

all_day?

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.

all_day_assigned?
all_day_change

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

all_day_changed?
all_day_default

all_day's default value

Source
all_day_present?
all_day_removed?
all_day_was
all_day_will_change!

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

apply_defaults

Generate code to apply default values

approved

approved getter

approved=(value : Bool)

approved setter

approved?

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.

approved_assigned?
approved_at

approved_at getter

approved_at=(value : Int64 | Nil)

approved_at setter

approved_at_assigned?
approved_at_change

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

approved_at_changed?
approved_at_default

approved_at's default value

Source
approved_at_present?
approved_at_removed?
approved_at_was
approved_at_will_change!

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

approved_change

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

approved_changed?
approved_default

approved's default value

Source
approved_present?
approved_removed?
approved_was
approved_will_change!

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

approver_email

approver_email getter

approver_email=(value : String | Nil)

approver_email setter

approver_email_assigned?
approver_email_change

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

approver_email_changed?
approver_email_default

approver_email's default value

Source
approver_email_present?
approver_email_removed?
approver_email_was
approver_email_will_change!

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

approver_id

approver_id getter

approver_id=(value : String | Nil)

approver_id setter

approver_id_assigned?
approver_id_change

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

approver_id_changed?
approver_id_default

approver_id's default value

Source
approver_id_present?
approver_id_removed?
approver_id_was
approver_id_will_change!

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

approver_name

approver_name getter

approver_name=(value : String | Nil)

approver_name setter

approver_name_assigned?
approver_name_change

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

approver_name_changed?
approver_name_default

approver_name's default value

Source
approver_name_present?
approver_name_removed?
approver_name_was
approver_name_will_change!

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

as_h(include_attendees : Bool = true)
Source
as_instance

ameba:disable Metrics/CyclomaticComplexity

Source
asset_id

asset_id getter

asset_id=(value : String)

asset_id setter

asset_id?

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.

asset_id_assigned?
asset_id_change

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

asset_id_changed?
asset_id_default

asset_id's default value

Source
asset_id_present?
asset_id_removed?
asset_id_was
asset_id_will_change!

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

asset_ids

asset_ids getter

asset_ids=(value : Array(String))

asset_ids setter

asset_ids?

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.

asset_ids_assigned?
asset_ids_change

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

asset_ids_changed?
asset_ids_default

asset_ids's default value

Source
asset_ids_present?
asset_ids_removed?
asset_ids_was
asset_ids_will_change!

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

assign_attributes(booking_type : String | Missing = Missing, booking_start : Int64 | Missing = Missing, booking_end : Int64 | Missing = Missing, timezone : String | Nil | Missing = Missing, asset_id : String | Missing = Missing, user_id : String | Nil | Missing = Missing, user_email : PlaceOS::Model::Email | Missing = Missing, user_name : String | Missing = Missing, zones : Array(String) | Missing = Missing, process_state : String | Nil | Missing = Missing, last_changed : Int64 | Nil | Missing = Missing, approved : Bool | Missing = Missing, approved_at : Int64 | Nil | Missing = Missing, rejected : Bool | Missing = Missing, rejected_at : Int64 | Nil | Missing = Missing, approver_id : String | Nil | Missing = Missing, approver_name : String | Nil | Missing = Missing, approver_email : String | Nil | Missing = Missing, department : String | Nil | Missing = Missing, title : String | Nil | Missing = Missing, checked_in : Bool | Missing = Missing, checked_in_at : Int64 | Nil | Missing = Missing, checked_out_at : Int64 | Nil | Missing = Missing, description : String | Nil | Missing = Missing, deleted : Bool | Missing = Missing, deleted_at : Int64 | Nil | Missing = Missing, booked_by_email : PlaceOS::Model::Email | Missing = Missing, booked_by_name : String | Missing = Missing, booked_from : String | Nil | Missing = Missing, extension_data : JSON::Any | Missing = Missing, history : Array(PlaceOS::Model::Booking::History) | Missing = Missing, email_digest : String | Nil | Missing = Missing, booked_by_id : String | Missing = Missing, booked_by_email_digest : String | Nil | Missing = Missing, created : Int64 | Nil | Missing = Missing, parent_id : Int64 | Nil | Missing = Missing, event_id : Int64 | Nil | Missing = Missing, instance : Int64 | Nil | Missing = Missing, utm_source : String | Nil | Missing = Missing, asset_ids : Array(String) | Missing = Missing, images : Array(String) | Missing = Missing, induction : PlaceOS::Model::Booking::Induction | Missing = Missing, permission : PlaceOS::Model::Booking::Permission | Missing = Missing, recurrence_type : PlaceOS::Model::Booking::Recurrence | Missing = Missing, recurrence_days : Int32 | Missing = Missing, recurrence_nth_of_month : Int32 | Missing = Missing, recurrence_interval : Int32 | Missing = Missing, recurrence_end : Int64 | Nil | Missing = Missing, all_day : Bool | Missing = Missing, tenant_id : Int64 | Nil | Missing = Missing, id : Int64 | Nil | Missing = Missing, created_at : Time | Missing = Missing, updated_at : Time | 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::Booking)

Assign to multiple attributes from a model object

assign_attributes_from_json(json, root : String)
assign_attributes_from_json(json)
assign_attributes_from_trusted_json(json, root : String)
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)
assign_attributes_from_yaml(yaml)

Uses the YAML parser as JSON is valid YAML

attendees
Source
attributes

Returns a Hash of all attribute values

attributes_tuple

Returns a NamedTuple of all attribute values.

before_create

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

before_destroy

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

before_save

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

before_update

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

booked_by_email

booked_by_email getter

booked_by_email=(value : PlaceOS::Model::Email)

booked_by_email setter

booked_by_email?

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.

booked_by_email_assigned?
booked_by_email_change

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

booked_by_email_changed?
booked_by_email_default

booked_by_email's default value

Source
booked_by_email_digest

booked_by_email_digest getter

booked_by_email_digest=(value : String | Nil)

booked_by_email_digest setter

booked_by_email_digest_assigned?
booked_by_email_digest_change

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

booked_by_email_digest_changed?
booked_by_email_digest_default

booked_by_email_digest's default value

Source
booked_by_email_digest_present?
booked_by_email_digest_removed?
booked_by_email_digest_was
booked_by_email_digest_will_change!

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

booked_by_email_present?
booked_by_email_removed?
booked_by_email_was
booked_by_email_will_change!

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

booked_by_id

booked_by_id getter

booked_by_id=(value : String)

booked_by_id setter

booked_by_id?

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.

booked_by_id_assigned?
booked_by_id_change

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

booked_by_id_changed?
booked_by_id_default

booked_by_id's default value

Source
booked_by_id_present?
booked_by_id_removed?
booked_by_id_was
booked_by_id_will_change!

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

booked_by_name

booked_by_name getter

booked_by_name=(value : String)

booked_by_name setter

booked_by_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.

booked_by_name_assigned?
booked_by_name_change

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

booked_by_name_changed?
booked_by_name_default

booked_by_name's default value

Source
booked_by_name_present?
booked_by_name_removed?
booked_by_name_was
booked_by_name_will_change!

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

booked_from

booked_from getter

booked_from=(value : String | Nil)

booked_from setter

booked_from_assigned?
booked_from_change

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

booked_from_changed?
booked_from_default

booked_from's default value

Source
booked_from_present?

if we want to record the system that performed the bookings (kiosk, mobile, swipe etc)

booked_from_removed?
booked_from_was
booked_from_will_change!

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

booking_current_state
Source
booking_end

booking_end getter

booking_end=(value : Int64)

booking_end setter

booking_end?

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.

booking_end_assigned?
booking_end_change

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

booking_end_changed?
booking_end_default

booking_end's default value

Source
booking_end_present?
booking_end_removed?
booking_end_was
booking_end_will_change!

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

booking_instances
Source
booking_start

booking_start getter

booking_start=(value : Int64)

booking_start setter

booking_start?

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.

booking_start_assigned?
booking_start_change

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

booking_start_changed?
booking_start_default

booking_start's default value

Source
booking_start_present?
booking_start_removed?
booking_start_was
booking_start_will_change!

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

booking_type

booking_type getter

booking_type=(value : String)

Setters booking_type setter

booking_type?

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.

booking_type_assigned?
booking_type_change

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

booking_type_changed?
booking_type_default

booking_type's default value

Source
booking_type_present?
booking_type_removed?
booking_type_was
booking_type_will_change!

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

calculate_daily(start_date : Time, end_date : Time, multiplier : Int32 = 1, limit : Int32 = Int32::MAX) : RecurrenceDetails
Source
calculate_monthly(start_date : Time, end_date : Time, limit : Int32 = Int32::MAX) : RecurrenceDetails
Source
calculate_weekly(start_date : Time, end_date : Time, limit : Int32 = Int32::MAX) : RecurrenceDetails
Source
change_extension_data(data : JSON::Any)
Source
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
changed_yaml(io : IO) : Nil

Serialize the set of changed attributes to YAML.

changed_yaml

Serialize the set of changed attributes to YAML.

checked_in

checked_in getter

checked_in=(value : Bool)

checked_in setter

checked_in?

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.

checked_in_assigned?
checked_in_at

checked_in_at getter

checked_in_at=(value : Int64 | Nil)

checked_in_at setter

checked_in_at_assigned?
checked_in_at_change

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

checked_in_at_changed?
checked_in_at_default

checked_in_at's default value

Source
checked_in_at_present?
checked_in_at_removed?
checked_in_at_was
checked_in_at_will_change!

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

checked_in_change

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

checked_in_changed?
checked_in_default

checked_in's default value

Source
checked_in_present?
checked_in_removed?
checked_in_was
checked_in_will_change!

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

checked_out_at

checked_out_at getter

checked_out_at=(value : Int64 | Nil)

checked_out_at setter

checked_out_at_assigned?
checked_out_at_change

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

checked_out_at_changed?
checked_out_at_default

checked_out_at's default value

Source
checked_out_at_present?
checked_out_at_removed?
checked_out_at_was
checked_out_at_will_change!

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

children
Source
clashing?
Source
clashing_bookings(ignore_assets : Bool = false, limit : Int32 | Nil = nil) : Array(Booking)
Source
cleanup_recurring_instances

remove any instance overrides if start times have changed

Source
clear_changes_information

Reset changes for all attributes.

created

created getter

created=(value : Int64 | Nil)

created setter

created_assigned?
created_at

created_at getter

created_at=(value : Time)

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?
created_at_change

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

created_at_changed?
created_at_default

created_at's default value

created_at_present?
created_at_removed?
created_at_was
created_at_will_change!

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

created_change

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

created_changed?
created_default

created's default value

Source
created_present?
created_removed?
created_was
created_will_change!

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

current_history
Source
current_state
Source
deleted

deleted getter

deleted=(value : Bool)

deleted setter

deleted?

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.

deleted_assigned?
deleted_at

deleted_at getter

deleted_at=(value : Int64 | Nil)

deleted_at setter

deleted_at_assigned?
deleted_at_change

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

deleted_at_changed?
deleted_at_default

deleted_at's default value

Source
deleted_at_present?
deleted_at_removed?
deleted_at_was
deleted_at_will_change!

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

deleted_change

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

deleted_changed?
deleted_default

deleted's default value

Source
deleted_present?
deleted_removed?
deleted_was
deleted_will_change!

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

department

department getter

department=(value : String | Nil)

department setter

department_assigned?
department_change

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

department_changed?
department_default

department's default value

Source
department_present?
department_removed?
department_was
department_will_change!

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

description

description getter

description=(value : String | Nil)

description setter

description_assigned?
description_change

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

description_changed?
description_default

description's default value

Source
description_present?
description_removed?
description_was
description_will_change!

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

destroy_attendees
email_digest

email_digest getter

email_digest=(value : String | Nil)

email_digest setter

email_digest_assigned?
email_digest_change

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

email_digest_changed?
email_digest_default

email_digest's default value

Source
email_digest_present?
email_digest_removed?
email_digest_was
email_digest_will_change!

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

ending_tz
Source
event_id

event_id getter

event_id=(value : Int64 | Nil)

event_id setter

event_id_assigned?
event_id_change

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

event_id_changed?
event_id_default

event_id's default value

Source
event_id_present?
event_id_removed?
event_id_was
event_id_will_change!

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

extension_data

extension_data getter

extension_data=(value : JSON::Any)

extension_data setter

extension_data?

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.

extension_data_assigned?
extension_data_change

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

extension_data_changed?
extension_data_default

extension_data's default value

Source
extension_data_present?
extension_data_removed?
extension_data_was
extension_data_will_change!

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

first_recurrence_month(start_date : Time, interval_months : Int32, year : Int32) : Int32
Source
get_nth_weekday_of_month(year : Int32, month : Int32, nth : Int32, valid_days : Array(Time::DayOfWeek), time_zone : Time::Location) : Int32

Helper function to find the nth day of a month

Source
guests

NOTE:: not to be used directly, only here for caching

Source
history

history getter

history setter

history?

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.

history_assigned?
history_change

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

history_changed?
history_default

history's default value

Source
history_present?
history_removed?
history_was
history_will_change!

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

hydrate_instance(starting_at : Int64) : Booking
Source
id

id getter

id=(value : Int64 | Nil)

id setter

id?
id_assigned?
id_change

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

id_changed?
id_default

id's default value

id_present?
id_removed?
id_was
id_will_change!

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

images

images getter

images=(value : Array(String))

images setter

images?

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.

images_assigned?
images_change

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

images_changed?
images_default

images's default value

Source
images_present?
images_removed?
images_was
images_will_change!

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

induction

induction getter

induction setter

induction?

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.

induction_assigned?
induction_change

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

induction_changed?
induction_default

induction's default value

Source
induction_present?
induction_removed?
induction_was
induction_will_change!

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

instance

Accessors for attributes without JSON mapping

instance=(value : Int64 | Nil)

instance setter

instance=(instance)

Accessors for attributes without JSON mapping

instance_assigned?
instance_change

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

instance_changed?
instance_default

instance's default value

Source
instance_present?
instance_removed?
instance_was
instance_will_change!

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

invoke_props

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

Source
last_changed

last_changed getter

last_changed=(value : Int64 | Nil)

last_changed setter

last_changed_assigned?
last_changed_change

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

last_changed_changed?
last_changed_default

last_changed's default value

Source
last_changed_present?
last_changed_removed?
last_changed_was
last_changed_will_change!

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

linked?
Source
linked_event
Source
parent
Source
parent=(parent : Booking | Nil)
Source
parent?
Source
parent_id

parent_id getter

parent_id=(value : Int64 | Nil)

parent_id setter

parent_id_assigned?
parent_id_change

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

parent_id_changed?
parent_id_default

parent_id's default value

Source
parent_id_present?
parent_id_removed?
parent_id_was
parent_id_will_change!

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

permission

permission getter

permission setter

permission?

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.

permission_assigned?
permission_change

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

permission_changed?
permission_default

permission's default value

Source
permission_present?
permission_removed?
permission_was
permission_will_change!

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

persistent_attributes

Returns a Hash of all attributes that can be persisted.

primary_key

Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk

Source
primary_key_hash
process_state

process_state getter

process_state=(value : String | Nil)

process_state setter

process_state_assigned?
process_state_change

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

process_state_changed?
process_state_default

process_state's default value

Source
process_state_present?

used to hold information relating to the state of the booking process

process_state_removed?
process_state_was
process_state_will_change!

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

recurrence_days

recurrence_days getter

recurrence_days=(bitmap : Int32)

reset recurrence_on when the bitmap changes

Source
recurrence_days?

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.

recurrence_days_assigned?
recurrence_days_change

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

recurrence_days_changed?
recurrence_days_default

recurrence_days's default value

Source
recurrence_days_present?
recurrence_days_removed?
recurrence_days_was
recurrence_days_will_change!

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

recurrence_end

recurrence_end getter

recurrence_end=(value : Int64 | Nil)

recurrence_end setter

recurrence_end_assigned?
recurrence_end_change

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

recurrence_end_changed?
recurrence_end_default

recurrence_end's default value

Source
recurrence_end_present?
recurrence_end_removed?
recurrence_end_was
recurrence_end_will_change!

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

recurrence_interval

recurrence_interval getter

recurrence_interval=(value : Int32)

recurrence_interval setter

recurrence_interval?

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.

recurrence_interval_assigned?
recurrence_interval_change

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

recurrence_interval_changed?
recurrence_interval_default

recurrence_interval's default value

Source
recurrence_interval_present?
recurrence_interval_removed?
recurrence_interval_was
recurrence_interval_will_change!

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

recurrence_nth_of_month

recurrence_nth_of_month getter

recurrence_nth_of_month=(value : Int32)

recurrence_nth_of_month setter

recurrence_nth_of_month?

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.

recurrence_nth_of_month_assigned?
recurrence_nth_of_month_change

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

recurrence_nth_of_month_changed?
recurrence_nth_of_month_default

recurrence_nth_of_month's default value

Source
recurrence_nth_of_month_present?
recurrence_nth_of_month_removed?
recurrence_nth_of_month_was
recurrence_nth_of_month_will_change!

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

recurrence_on
Source
recurrence_type

recurrence_type getter

recurrence_type=(value : PlaceOS::Model::Booking::Recurrence)

recurrence_type setter

recurrence_type?

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.

recurrence_type_assigned?
recurrence_type_change

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

recurrence_type_changed?
recurrence_type_default

recurrence_type's default value

Source
recurrence_type_present?
recurrence_type_removed?
recurrence_type_was
recurrence_type_will_change!

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

recurring_booking?
Source
recurring_instance?
Source
rejected

rejected getter

rejected=(value : Bool)

rejected setter

rejected?

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.

rejected_assigned?
rejected_at

rejected_at getter

rejected_at=(value : Int64 | Nil)

rejected_at setter

rejected_at_assigned?
rejected_at_change

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

rejected_at_changed?
rejected_at_default

rejected_at's default value

Source
rejected_at_present?
rejected_at_removed?
rejected_at_was
rejected_at_will_change!

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

rejected_change

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

rejected_changed?
rejected_default

rejected's default value

Source
rejected_present?
rejected_removed?
rejected_was
rejected_will_change!

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

render_event
Source
render_event=(render_event : Bool)
Source
req_attendees
Source
req_attendees=(req_attendees : Array(PlaceCalendar::Event::Attendee) | Nil)
Source
reset_associations
Source
resp_attendees
Source
restore_attributes

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

save

reset recurrence_on when the bitmap changes

Source
save!

reset recurrence_on when the bitmap changes

Source
set_created
Source
skip_clash_check

transient flag (never (de)serialised, so API clients cannot set it): callers that have already performed an explicit clash check -- e.g. the bookings controller, which needs the full clashing list for its 409 response -- set this so save! does not redundantly re-run the (expensive) clash detection.

Source
skip_clash_check=(skip_clash_check : Bool)

transient flag (never (de)serialised, so API clients cannot set it): callers that have already performed an explicit clash check -- e.g. the bookings controller, which needs the full clashing list for its 409 response -- set this so save! does not redundantly re-run the (expensive) clash detection.

Source
slot_changed?

the clash validation only needs to run when the booked slot itself changes: the time, the asset(s), or -- for a recurring booking -- the recurrence pattern (which adds/removes occupied occurrences). approving, rejecting or checking in an existing booking must not be blocked by a clash it did not introduce.

Source
starting_tz
Source
survey_trigger
Source
table_name
tenant

Retrieves the parent relationship

Source
tenant!
Source
tenant=(parent : Tenant)

Sets the parent relationship

Source
tenant_id

tenant_id getter

tenant_id=(value : Int64 | Nil)

tenant_id setter

tenant_id_assigned?
tenant_id_change

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

tenant_id_changed?
tenant_id_default

tenant_id's default value

tenant_id_present?
tenant_id_removed?
tenant_id_was
tenant_id_will_change!

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

timezone

timezone getter

timezone=(value : String | Nil)

timezone setter

timezone_assigned?
timezone_change

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

timezone_changed?
timezone_default

timezone's default value

Source
timezone_present?
timezone_removed?
timezone_was
timezone_will_change!

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

title

title getter

title=(value : String | Nil)

title setter

title_assigned?
title_change

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

title_changed?
title_default

title's default value

Source
title_present?
title_removed?
title_was
title_will_change!

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

to_instance(starting_at : Int64 = self.booking_start)
Source
to_json(json : JSON::Builder)
Source
trigger_survey_invitations(state : State) : Nil

Invites the host to any survey configured to fire on this state.

Public and state-parameterised so a recurrence occurrence can reuse it: BookingInstance owns its own history, and the surveys that apply are the ones configured against this booking's zones and host, so it calls this on the hydrated occurrence (see BookingInstance#update_history).

Source
unique_ids?
Source
update_assets
Source
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?
updated_at_change

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

updated_at_changed?
updated_at_default

updated_at's default value

updated_at_present?
updated_at_removed?
updated_at_was
updated_at_will_change!

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

user_email

user_email getter

user_email=(value : PlaceOS::Model::Email)

user_email setter

user_email?

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.

user_email_assigned?
user_email_change

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

user_email_changed?
user_email_default

user_email's default value

Source
user_email_present?
user_email_removed?
user_email_was
user_email_will_change!

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

user_id

user_id getter

user_id=(value : String | Nil)

user_id setter

user_id_assigned?
user_id_change

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

user_id_changed?
user_id_default

user_id's default value

Source
user_id_present?
user_id_removed?
user_id_was
user_id_will_change!

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

user_name

user_name getter

user_name=(value : String)

user_name setter

user_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.

user_name_assigned?
user_name_change

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

user_name_changed?
user_name_default

user_name's default value

Source
user_name_present?
user_name_removed?
user_name_was
user_name_will_change!

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

utm_source

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.

utm_source=(value : String | Nil)

utm_source setter

utm_source=(utm_source)
utm_source_assigned?
utm_source_change

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

utm_source_changed?
utm_source_default

utm_source's default value

Source
utm_source_present?
utm_source_removed?
utm_source_was
utm_source_will_change!

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

validate_nilability

Validate that all non-nillable fields have values.

zones

zones getter

zones=(value : Array(String))

zones setter

zones?

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.

zones_assigned?
zones_change

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

zones_changed?
zones_default

zones's default value

Source
zones_present?
zones_removed?
zones_was
zones_will_change!

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

Macros

scope(name, &block)

Nested types