class PlaceOS::Model::Booking
- PlaceOS::Model::Booking
- PlaceOS::Model::ModelWithAutoKey
- PgORM::Base
- ActiveModel::Model
- Reference
- Object
Included Modules
Defined in:
placeos-models/booking.crConstant Summary
-
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}) else if deleted_changed? || deleted_at_changed? Booking.where(parent_id: id).update_all({:deleted => deleted, :deleted_at => deleted_at}) else if (((((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 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)
-
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. - .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(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(pull : JSON::PullParser)
- .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, 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)
-
.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Initialize PlaceOS::Model::Booking from
HTTP::Params
.
Class Method Summary
-
.attributes : Array(Symbol)
Returns all attribute keys.
- .auto_generate_id : Bool
- .booked_between(tenant_id, period_start, period_end)
- .by_tenant(tenant_id)
-
.by_tenant_id(id)
Look up instances of this model dependent on the foreign key
- .by_user_id(user_id)
- .by_user_or_email(user_id_value, user_email_value, include_booked_by, include_open_permission, include_public_permission)
- .by_user_or_email(user_id_value, user_email_value, include_booked_by)
-
.by_zones(zones)
Bookings have the zones in an array.
-
.changes(id : PrimaryKeyType = nil) : ChangeFeed
Changefeed at row (if
#id
passed) or whole table level. - .elastic
-
.expand_bookings!(starting : Time, ending : Time, parents : Array(Booking), limit : Int32 = DEFAULT_LIMIT, skip : Int32 = 0, is_checked_out : Bool | Nil = nil) : ExpansionDetails
modifies the array, injecting the recurrences ameba:disable Metrics/CyclomaticComplexity
- .from_rs(__temp_579 : DB::ResultSet)
- .is_approved(value)
- .is_booking_type(booking_type)
- .is_checked_in(value)
- .is_created_after(time)
- .is_created_before(time)
- .is_department(value)
- .is_extension_data(value)
- .is_rejected(value)
- .is_state(state)
- .on_error(err : Exception | IO::Error)
- .primary_key : Symbol
- .table_name
Macro Summary
Instance Method Summary
-
#__guests_rel : Array(Guest)
NOTE : not to be used directly, only here for caching
- #__tenant : Tenant | Nil
- #__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
-
#apply_defaults
Generate code to apply default values
-
#approved : Bool
#approved
getter -
#approved=(value : Bool)
#approved
setter -
#approved? : Bool | Nil
Assign instance variable to correct type
- #approved_assigned? : Bool
-
#approved_at : Int64 | Nil
#approved_at
getter -
#approved_at=(value : Int64 | Nil)
#approved_at
setter - #approved_at_assigned? : Bool
-
#approved_at_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #approved_at_changed? : Bool
-
#approved_at_default : Int64 | Nil
#approved_at
's default value - #approved_at_present? : Bool
- #approved_at_was : Int64 | Nil | Nil
-
#approved_at_will_change! : Nil
Include
#approved_at
in the set of changed attributes, whether it has changed or not. -
#approved_change : Tuple(Bool | Nil, Bool | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #approved_changed? : Bool
-
#approved_default : Bool
#approved
's default value - #approved_present? : Bool
- #approved_was : Bool | Nil
-
#approved_will_change! : Nil
Include
#approved
in the set of changed attributes, whether it has changed or not. -
#approver_email : String | Nil
#approver_email
getter -
#approver_email=(value : String | Nil)
#approver_email
setter - #approver_email_assigned? : Bool
-
#approver_email_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #approver_email_changed? : Bool
-
#approver_email_default : String | Nil
#approver_email
's default value - #approver_email_present? : Bool
- #approver_email_was : String | Nil | Nil
-
#approver_email_will_change! : Nil
Include
#approver_email
in the set of changed attributes, whether it has changed or not. -
#approver_id : String | Nil
#approver_id
getter -
#approver_id=(value : String | Nil)
#approver_id
setter - #approver_id_assigned? : Bool
-
#approver_id_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #approver_id_changed? : Bool
-
#approver_id_default : String | Nil
#approver_id
's default value - #approver_id_present? : Bool
- #approver_id_was : String | Nil | Nil
-
#approver_id_will_change! : Nil
Include
#approver_id
in the set of changed attributes, whether it has changed or not. -
#approver_name : String | Nil
#approver_name
getter -
#approver_name=(value : String | Nil)
#approver_name
setter - #approver_name_assigned? : Bool
-
#approver_name_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #approver_name_changed? : Bool
-
#approver_name_default : String | Nil
#approver_name
's default value - #approver_name_present? : Bool
- #approver_name_was : String | Nil | Nil
-
#approver_name_will_change! : Nil
Include
#approver_name
in the set of changed attributes, whether it has changed or not. - #as_h(include_attendees : Bool = true)
- #as_instance
-
#asset_id : String
#asset_id
getter -
#asset_id=(value : String)
#asset_id
setter -
#asset_id? : String | Nil
Assign instance variable to correct type
- #asset_id_assigned? : Bool
-
#asset_id_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #asset_id_changed? : Bool
-
#asset_id_default : String
#asset_id
's default value - #asset_id_present? : Bool
- #asset_id_was : String | Nil
-
#asset_id_will_change! : Nil
Include
#asset_id
in the set of changed attributes, whether it has changed or not. -
#asset_ids : Array(String)
#asset_ids
getter -
#asset_ids=(value : Array(String))
#asset_ids
setter -
#asset_ids? : Array(String) | Nil
Assign instance variable to correct type
- #asset_ids_assigned? : Bool
-
#asset_ids_change : Tuple(Array(String) | Nil, Array(String) | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #asset_ids_changed? : Bool
-
#asset_ids_default : Array(String)
#asset_ids
's default value - #asset_ids_present? : Bool
- #asset_ids_was : Array(String) | Nil
-
#asset_ids_will_change! : Nil
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, 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 mulitple 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
-
#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 : PlaceOS::Model::Email
#booked_by_email
getter -
#booked_by_email=(value : PlaceOS::Model::Email)
#booked_by_email
setter -
#booked_by_email? : PlaceOS::Model::Email | Nil
Assign instance variable to correct type
- #booked_by_email_assigned? : Bool
-
#booked_by_email_change : Tuple(PlaceOS::Model::Email | Nil, PlaceOS::Model::Email | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #booked_by_email_changed? : Bool
-
#booked_by_email_default : PlaceOS::Model::Email
#booked_by_email
's default value -
#booked_by_email_digest : String | Nil
#booked_by_email_digest
getter -
#booked_by_email_digest=(value : String | Nil)
#booked_by_email_digest
setter - #booked_by_email_digest_assigned? : Bool
-
#booked_by_email_digest_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #booked_by_email_digest_changed? : Bool
-
#booked_by_email_digest_default : String | Nil
#booked_by_email_digest
's default value - #booked_by_email_digest_present? : Bool
- #booked_by_email_digest_was : String | Nil | Nil
-
#booked_by_email_digest_will_change! : Nil
Include
#booked_by_email_digest
in the set of changed attributes, whether it has changed or not. - #booked_by_email_present? : Bool
- #booked_by_email_was : PlaceOS::Model::Email | Nil
-
#booked_by_email_will_change! : Nil
Include
#booked_by_email
in the set of changed attributes, whether it has changed or not. -
#booked_by_id : String
#booked_by_id
getter -
#booked_by_id=(value : String)
#booked_by_id
setter -
#booked_by_id? : String | Nil
Assign instance variable to correct type
- #booked_by_id_assigned? : Bool
-
#booked_by_id_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #booked_by_id_changed? : Bool
-
#booked_by_id_default : String
#booked_by_id
's default value - #booked_by_id_present? : Bool
- #booked_by_id_was : String | Nil
-
#booked_by_id_will_change! : Nil
Include
#booked_by_id
in the set of changed attributes, whether it has changed or not. -
#booked_by_name : String
#booked_by_name
getter -
#booked_by_name=(value : String)
#booked_by_name
setter -
#booked_by_name? : String | Nil
Assign instance variable to correct type
- #booked_by_name_assigned? : Bool
-
#booked_by_name_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #booked_by_name_changed? : Bool
-
#booked_by_name_default : String
#booked_by_name
's default value - #booked_by_name_present? : Bool
- #booked_by_name_was : String | Nil
-
#booked_by_name_will_change! : Nil
Include
#booked_by_name
in the set of changed attributes, whether it has changed or not. -
#booked_from : String | Nil
#booked_from
getter -
#booked_from=(value : String | Nil)
#booked_from
setter - #booked_from_assigned? : Bool
-
#booked_from_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #booked_from_changed? : Bool
-
#booked_from_default : String | Nil
#booked_from
's default value -
#booked_from_present? : Bool
if we want to record the system that performed the bookings (kiosk, mobile, swipe etc)
- #booked_from_was : String | Nil | Nil
-
#booked_from_will_change! : Nil
Include
#booked_from
in the set of changed attributes, whether it has changed or not. - #booking_current_state : State
-
#booking_end : Int64
#booking_end
getter -
#booking_end=(value : Int64)
#booking_end
setter -
#booking_end? : Int64 | Nil
Assign instance variable to correct type
- #booking_end_assigned? : Bool
-
#booking_end_change : Tuple(Int64 | Nil, Int64 | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #booking_end_changed? : Bool
-
#booking_end_default : Int64
#booking_end
's default value - #booking_end_present? : Bool
- #booking_end_was : Int64 | Nil
-
#booking_end_will_change! : Nil
Include
#booking_end
in the set of changed attributes, whether it has changed or not. - #booking_instances
-
#booking_start : Int64
#booking_start
getter -
#booking_start=(value : Int64)
#booking_start
setter -
#booking_start? : Int64 | Nil
Assign instance variable to correct type
- #booking_start_assigned? : Bool
-
#booking_start_change : Tuple(Int64 | Nil, Int64 | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #booking_start_changed? : Bool
-
#booking_start_default : Int64
#booking_start
's default value - #booking_start_present? : Bool
- #booking_start_was : Int64 | Nil
-
#booking_start_will_change! : Nil
Include
#booking_start
in the set of changed attributes, whether it has changed or not. -
#booking_type : String
#booking_type
getter -
#booking_type=(value : String)
Setters
#booking_type
setter -
#booking_type? : String | Nil
Assign instance variable to correct type
- #booking_type_assigned? : Bool
-
#booking_type_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #booking_type_changed? : Bool
-
#booking_type_default : String
#booking_type
's default value - #booking_type_present? : Bool
- #booking_type_was : String | Nil
-
#booking_type_will_change! : Nil
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
- #calculate_monthly(start_date : Time, end_date : Time, limit : Int32 = Int32::MAX) : RecurrenceDetails
- #calculate_weekly(start_date : Time, end_date : Time, limit : Int32 = Int32::MAX) : RecurrenceDetails
- #change_extension_data(data : JSON::Any)
-
#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 : String
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 : String
Serialize the set of changed attributes to YAML.
-
#checked_in : Bool
#checked_in
getter -
#checked_in=(value : Bool)
#checked_in
setter -
#checked_in? : Bool | Nil
Assign instance variable to correct type
- #checked_in_assigned? : Bool
-
#checked_in_at : Int64 | Nil
#checked_in_at
getter -
#checked_in_at=(value : Int64 | Nil)
#checked_in_at
setter - #checked_in_at_assigned? : Bool
-
#checked_in_at_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #checked_in_at_changed? : Bool
-
#checked_in_at_default : Int64 | Nil
#checked_in_at
's default value - #checked_in_at_present? : Bool
- #checked_in_at_was : Int64 | Nil | Nil
-
#checked_in_at_will_change! : Nil
Include
#checked_in_at
in the set of changed attributes, whether it has changed or not. -
#checked_in_change : Tuple(Bool | Nil, Bool | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #checked_in_changed? : Bool
-
#checked_in_default : Bool
#checked_in
's default value - #checked_in_present? : Bool
- #checked_in_was : Bool | Nil
-
#checked_in_will_change! : Nil
Include
#checked_in
in the set of changed attributes, whether it has changed or not. -
#checked_out_at : Int64 | Nil
#checked_out_at
getter -
#checked_out_at=(value : Int64 | Nil)
#checked_out_at
setter - #checked_out_at_assigned? : Bool
-
#checked_out_at_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #checked_out_at_changed? : Bool
-
#checked_out_at_default : Int64 | Nil
#checked_out_at
's default value - #checked_out_at_present? : Bool
- #checked_out_at_was : Int64 | Nil | Nil
-
#checked_out_at_will_change! : Nil
Include
#checked_out_at
in the set of changed attributes, whether it has changed or not. - #children : Array(Booking) | Nil
- #clashing? : Bool
- #clashing_bookings : Array(Booking)
-
#cleanup_recurring_instances : Nil
remove any instance overrides if start times have changed
-
#clear_changes_information
Reset changes for all attributes.
-
#created : Int64 | Nil
#created
getter -
#created=(value : Int64 | Nil)
#created
setter - #created_assigned? : Bool
-
#created_at : Time
#created_at
getter -
#created_at=(value : Time)
#created_at
setter -
#created_at? : Time | Nil
Assign instance variable to correct type
- #created_at_assigned? : Bool
-
#created_at_change : Tuple(Time | Nil, Time | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #created_at_changed? : Bool
-
#created_at_default : Time
#created_at
's default value - #created_at_present? : Bool
- #created_at_was : Time | Nil
-
#created_at_will_change! : Nil
Include
#created_at
in the set of changed attributes, whether it has changed or not. -
#created_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #created_changed? : Bool
-
#created_default : Int64 | Nil
#created
's default value - #created_present? : Bool
- #created_was : Int64 | Nil | Nil
-
#created_will_change! : Nil
Include
#created
in the set of changed attributes, whether it has changed or not. - #current_history : Array(History)
- #current_state : State
-
#deleted : Bool
#deleted
getter -
#deleted=(value : Bool)
#deleted
setter -
#deleted? : Bool | Nil
Assign instance variable to correct type
- #deleted_assigned? : Bool
-
#deleted_at : Int64 | Nil
#deleted_at
getter -
#deleted_at=(value : Int64 | Nil)
#deleted_at
setter - #deleted_at_assigned? : Bool
-
#deleted_at_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #deleted_at_changed? : Bool
-
#deleted_at_default : Int64 | Nil
#deleted_at
's default value - #deleted_at_present? : Bool
- #deleted_at_was : Int64 | Nil | Nil
-
#deleted_at_will_change! : Nil
Include
#deleted_at
in the set of changed attributes, whether it has changed or not. -
#deleted_change : Tuple(Bool | Nil, Bool | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #deleted_changed? : Bool
-
#deleted_default : Bool
#deleted
's default value - #deleted_present? : Bool
- #deleted_was : Bool | Nil
-
#deleted_will_change! : Nil
Include
#deleted
in the set of changed attributes, whether it has changed or not. -
#department : String | Nil
#department
getter -
#department=(value : String | Nil)
#department
setter - #department_assigned? : Bool
-
#department_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #department_changed? : Bool
-
#department_default : String | Nil
#department
's default value - #department_present? : Bool
- #department_was : String | Nil | Nil
-
#department_will_change! : Nil
Include
#department
in the set of changed attributes, whether it has changed or not. -
#description : String | Nil
#description
getter -
#description=(value : String | Nil)
#description
setter - #description_assigned? : Bool
-
#description_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #description_changed? : Bool
-
#description_default : String | Nil
#description
's default value - #description_present? : Bool
- #description_was : String | Nil | Nil
-
#description_will_change! : Nil
Include
#description
in the set of changed attributes, whether it has changed or not. - #destroy_attendees
-
#email_digest : String | Nil
#email_digest
getter -
#email_digest=(value : String | Nil)
#email_digest
setter - #email_digest_assigned? : Bool
-
#email_digest_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #email_digest_changed? : Bool
-
#email_digest_default : String | Nil
#email_digest
's default value - #email_digest_present? : Bool
- #email_digest_was : String | Nil | Nil
-
#email_digest_will_change! : Nil
Include
#email_digest
in the set of changed attributes, whether it has changed or not. - #ending_tz : Time
-
#event_id : Int64 | Nil
#event_id
getter -
#event_id=(value : Int64 | Nil)
#event_id
setter - #event_id_assigned? : Bool
-
#event_id_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #event_id_changed? : Bool
-
#event_id_default : Int64 | Nil
#event_id
's default value - #event_id_present? : Bool
- #event_id_was : Int64 | Nil | Nil
-
#event_id_will_change! : Nil
Include
#event_id
in the set of changed attributes, whether it has changed or not. -
#extension_data : JSON::Any
#extension_data
getter -
#extension_data=(value : JSON::Any)
#extension_data
setter -
#extension_data? : JSON::Any | Nil
Assign instance variable to correct type
- #extension_data_assigned? : Bool
-
#extension_data_change : Tuple(JSON::Any | Nil, JSON::Any | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #extension_data_changed? : Bool
-
#extension_data_default : JSON::Any
#extension_data
's default value - #extension_data_present? : Bool
- #extension_data_was : JSON::Any | Nil
-
#extension_data_will_change! : Nil
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
-
#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
-
#guests
NOTE : not to be used directly, only here for caching
-
#history : Array(PlaceOS::Model::Booking::History)
#history
getter -
#history=(value : Array(PlaceOS::Model::Booking::History))
#history
setter -
#history? : Array(PlaceOS::Model::Booking::History) | Nil
Assign instance variable to correct type
- #history_assigned? : Bool
-
#history_change : Tuple(Array(PlaceOS::Model::Booking::History) | Nil, Array(PlaceOS::Model::Booking::History) | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #history_changed? : Bool
-
#history_default : Array(History)
#history
's default value - #history_present? : Bool
- #history_was : Array(PlaceOS::Model::Booking::History) | Nil
-
#history_will_change! : Nil
Include
#history
in the set of changed attributes, whether it has changed or not. - #hydrate_instance(starting_at : Int64) : Booking
-
#id : Int64 | Nil
#id
getter -
#id=(value : Int64 | Nil)
#id
setter -
#id? : Int64 | Nil | Nil
Same as
#id
but may returnnil
when the record hasn't been saved instead of raising. - #id_assigned? : Bool
-
#id_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #id_changed? : Bool
-
#id_default : Int64 | Nil
#id
's default value - #id_present? : Bool
- #id_was : Int64 | Nil | Nil
-
#id_will_change! : Nil
Include
#id
in the set of changed attributes, whether it has changed or not. -
#images : Array(String)
#images
getter -
#images=(value : Array(String))
#images
setter -
#images? : Array(String) | Nil
Assign instance variable to correct type
- #images_assigned? : Bool
-
#images_change : Tuple(Array(String) | Nil, Array(String) | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #images_changed? : Bool
-
#images_default : Array(String)
#images
's default value - #images_present? : Bool
- #images_was : Array(String) | Nil
-
#images_will_change! : Nil
Include
#images
in the set of changed attributes, whether it has changed or not. -
#induction : PlaceOS::Model::Booking::Induction
#induction
getter -
#induction=(value : PlaceOS::Model::Booking::Induction)
#induction
setter -
#induction? : PlaceOS::Model::Booking::Induction | Nil
Assign instance variable to correct type
- #induction_assigned? : Bool
-
#induction_change : Tuple(PlaceOS::Model::Booking::Induction | Nil, PlaceOS::Model::Booking::Induction | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #induction_changed? : Bool
-
#induction_default : Induction
#induction
's default value - #induction_present? : Bool
- #induction_was : PlaceOS::Model::Booking::Induction | Nil
-
#induction_will_change! : Nil
Include
#induction
in the set of changed attributes, whether it has changed or not. -
#instance : Int64?
Accessors for attributes without JSON mapping
-
#instance=(value : Int64 | Nil)
#instance
setter -
#instance=(instance)
Accessors for attributes without JSON mapping
- #instance_assigned? : Bool
-
#instance_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #instance_changed? : Bool
-
#instance_default : Int64 | Nil
#instance
's default value - #instance_present? : Bool
- #instance_was : Int64 | Nil | Nil
-
#instance_will_change! : Nil
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
-
#last_changed : Int64 | Nil
#last_changed
getter -
#last_changed=(value : Int64 | Nil)
#last_changed
setter - #last_changed_assigned? : Bool
-
#last_changed_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #last_changed_changed? : Bool
-
#last_changed_default : Int64 | Nil
#last_changed
's default value - #last_changed_present? : Bool
- #last_changed_was : Int64 | Nil | Nil
-
#last_changed_will_change! : Nil
Include
#last_changed
in the set of changed attributes, whether it has changed or not. - #linked?
- #linked_event : EventMetadata | Nil
- #parent?
-
#parent_id : Int64 | Nil
#parent_id
getter -
#parent_id=(value : Int64 | Nil)
#parent_id
setter - #parent_id_assigned? : Bool
-
#parent_id_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #parent_id_changed? : Bool
-
#parent_id_default : Int64 | Nil
#parent_id
's default value - #parent_id_present? : Bool
- #parent_id_was : Int64 | Nil | Nil
-
#parent_id_will_change! : Nil
Include
#parent_id
in the set of changed attributes, whether it has changed or not. -
#permission : PlaceOS::Model::Booking::Permission
#permission
getter -
#permission=(value : PlaceOS::Model::Booking::Permission)
#permission
setter -
#permission? : PlaceOS::Model::Booking::Permission | Nil
Assign instance variable to correct type
- #permission_assigned? : Bool
-
#permission_change : Tuple(PlaceOS::Model::Booking::Permission | Nil, PlaceOS::Model::Booking::Permission | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #permission_changed? : Bool
-
#permission_default : Permission
#permission
's default value - #permission_present? : Bool
- #permission_was : PlaceOS::Model::Booking::Permission | Nil
-
#permission_will_change! : Nil
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. -
#process_state : String | Nil
#process_state
getter -
#process_state=(value : String | Nil)
#process_state
setter - #process_state_assigned? : Bool
-
#process_state_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #process_state_changed? : Bool
-
#process_state_default : String | Nil
#process_state
's default value -
#process_state_present? : Bool
used to hold information relating to the state of the booking process
- #process_state_was : String | Nil | Nil
-
#process_state_will_change! : Nil
Include
#process_state
in the set of changed attributes, whether it has changed or not. -
#recurrence_days : Int32
#recurrence_days
getter -
#recurrence_days=(bitmap : Int32)
reset recurrence_on when the bitmap changes
-
#recurrence_days? : Int32 | Nil
Assign instance variable to correct type
- #recurrence_days_assigned? : Bool
-
#recurrence_days_change : Tuple(Int32 | Nil, Int32 | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #recurrence_days_changed? : Bool
-
#recurrence_days_default : Int32
#recurrence_days
's default value - #recurrence_days_present? : Bool
- #recurrence_days_was : Int32 | Nil
-
#recurrence_days_will_change! : Nil
Include
#recurrence_days
in the set of changed attributes, whether it has changed or not. -
#recurrence_end : Int64 | Nil
#recurrence_end
getter -
#recurrence_end=(value : Int64 | Nil)
#recurrence_end
setter - #recurrence_end_assigned? : Bool
-
#recurrence_end_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #recurrence_end_changed? : Bool
-
#recurrence_end_default : Int64 | Nil
#recurrence_end
's default value - #recurrence_end_present? : Bool
- #recurrence_end_was : Int64 | Nil | Nil
-
#recurrence_end_will_change! : Nil
Include
#recurrence_end
in the set of changed attributes, whether it has changed or not. -
#recurrence_interval : Int32
#recurrence_interval
getter -
#recurrence_interval=(value : Int32)
#recurrence_interval
setter -
#recurrence_interval? : Int32 | Nil
Assign instance variable to correct type
- #recurrence_interval_assigned? : Bool
-
#recurrence_interval_change : Tuple(Int32 | Nil, Int32 | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #recurrence_interval_changed? : Bool
-
#recurrence_interval_default : Int32
#recurrence_interval
's default value - #recurrence_interval_present? : Bool
- #recurrence_interval_was : Int32 | Nil
-
#recurrence_interval_will_change! : Nil
Include
#recurrence_interval
in the set of changed attributes, whether it has changed or not. -
#recurrence_nth_of_month : Int32
#recurrence_nth_of_month
getter -
#recurrence_nth_of_month=(value : Int32)
#recurrence_nth_of_month
setter -
#recurrence_nth_of_month? : Int32 | Nil
Assign instance variable to correct type
- #recurrence_nth_of_month_assigned? : Bool
-
#recurrence_nth_of_month_change : Tuple(Int32 | Nil, Int32 | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #recurrence_nth_of_month_changed? : Bool
-
#recurrence_nth_of_month_default : Int32
#recurrence_nth_of_month
's default value - #recurrence_nth_of_month_present? : Bool
- #recurrence_nth_of_month_was : Int32 | Nil
-
#recurrence_nth_of_month_will_change! : Nil
Include
#recurrence_nth_of_month
in the set of changed attributes, whether it has changed or not. - #recurrence_on : Array(Time::DayOfWeek)
-
#recurrence_type : PlaceOS::Model::Booking::Recurrence
#recurrence_type
getter -
#recurrence_type=(value : PlaceOS::Model::Booking::Recurrence)
#recurrence_type
setter -
#recurrence_type? : PlaceOS::Model::Booking::Recurrence | Nil
Assign instance variable to correct type
- #recurrence_type_assigned? : Bool
-
#recurrence_type_change : Tuple(PlaceOS::Model::Booking::Recurrence | Nil, PlaceOS::Model::Booking::Recurrence | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #recurrence_type_changed? : Bool
-
#recurrence_type_default : Recurrence
#recurrence_type
's default value - #recurrence_type_present? : Bool
- #recurrence_type_was : PlaceOS::Model::Booking::Recurrence | Nil
-
#recurrence_type_will_change! : Nil
Include
#recurrence_type
in the set of changed attributes, whether it has changed or not. - #recurring_booking? : Bool
- #recurring_instance? : Bool
-
#rejected : Bool
#rejected
getter -
#rejected=(value : Bool)
#rejected
setter -
#rejected? : Bool | Nil
Assign instance variable to correct type
- #rejected_assigned? : Bool
-
#rejected_at : Int64 | Nil
#rejected_at
getter -
#rejected_at=(value : Int64 | Nil)
#rejected_at
setter - #rejected_at_assigned? : Bool
-
#rejected_at_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #rejected_at_changed? : Bool
-
#rejected_at_default : Int64 | Nil
#rejected_at
's default value - #rejected_at_present? : Bool
- #rejected_at_was : Int64 | Nil | Nil
-
#rejected_at_will_change! : Nil
Include
#rejected_at
in the set of changed attributes, whether it has changed or not. -
#rejected_change : Tuple(Bool | Nil, Bool | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #rejected_changed? : Bool
-
#rejected_default : Bool
#rejected
's default value - #rejected_present? : Bool
- #rejected_was : Bool | Nil
-
#rejected_will_change! : Nil
Include
#rejected
in the set of changed attributes, whether it has changed or not. - #render_event : Bool
- #render_event=(render_event : Bool)
- #req_attendees : Array(PlaceCalendar::Event::Attendee) | Nil
- #req_attendees=(req_attendees : Array(PlaceCalendar::Event::Attendee) | Nil)
- #reset_associations
- #resp_attendees : Array(Attendee) | Nil
-
#restore_attributes
Reset each attribute to their previous values and clears all changes.
-
#run_create_callbacks(&)
Wrap a block with callbacks for the appropriate crud operation
-
#run_destroy_callbacks(&)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#run_save_callbacks(&)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#run_update_callbacks(&)
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
-
#save
reset recurrence_on when the bitmap changes
-
#save!
reset recurrence_on when the bitmap changes
- #set_created
- #starting_tz : Time
- #survey_trigger
- #table_name
-
#tenant : Tenant | Nil
Retrieves the parent relationship
- #tenant! : Tenant
-
#tenant=(parent : Tenant)
Sets the parent relationship
-
#tenant_id : Int64 | Nil
#tenant_id
getter -
#tenant_id=(value : Int64 | Nil)
#tenant_id
setter - #tenant_id_assigned? : Bool
-
#tenant_id_change : Tuple(Int64 | Nil | Nil, Int64 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #tenant_id_changed? : Bool
-
#tenant_id_default : Int64 | Nil
#tenant_id
's default value - #tenant_id_present? : Bool
- #tenant_id_was : Int64 | Nil | Nil
-
#tenant_id_will_change! : Nil
Include
#tenant_id
in the set of changed attributes, whether it has changed or not. -
#timezone : String | Nil
#timezone
getter -
#timezone=(value : String | Nil)
#timezone
setter - #timezone_assigned? : Bool
-
#timezone_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #timezone_changed? : Bool
-
#timezone_default : String | Nil
#timezone
's default value - #timezone_present? : Bool
- #timezone_was : String | Nil | Nil
-
#timezone_will_change! : Nil
Include
#timezone
in the set of changed attributes, whether it has changed or not. -
#title : String | Nil
#title
getter -
#title=(value : String | Nil)
#title
setter - #title_assigned? : Bool
-
#title_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #title_changed? : Bool
-
#title_default : String | Nil
#title
's default value - #title_present? : Bool
- #title_was : String | Nil | Nil
-
#title_will_change! : Nil
Include
#title
in the set of changed attributes, whether it has changed or not. - #to_instance(starting_at : Int64 = self.booking_start)
- #to_json(json : JSON::Builder)
- #unique_ids?
- #update_assets
-
#updated_at : Time
#updated_at
getter -
#updated_at=(value : Time)
#updated_at
setter -
#updated_at? : Time | Nil
Assign instance variable to correct type
- #updated_at_assigned? : Bool
-
#updated_at_change : Tuple(Time | Nil, Time | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #updated_at_changed? : Bool
-
#updated_at_default : Time
#updated_at
's default value - #updated_at_present? : Bool
- #updated_at_was : Time | Nil
-
#updated_at_will_change! : Nil
Include
#updated_at
in the set of changed attributes, whether it has changed or not. -
#user_email : PlaceOS::Model::Email
#user_email
getter -
#user_email=(value : PlaceOS::Model::Email)
#user_email
setter -
#user_email? : PlaceOS::Model::Email | Nil
Assign instance variable to correct type
- #user_email_assigned? : Bool
-
#user_email_change : Tuple(PlaceOS::Model::Email | Nil, PlaceOS::Model::Email | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #user_email_changed? : Bool
-
#user_email_default : PlaceOS::Model::Email
#user_email
's default value - #user_email_present? : Bool
- #user_email_was : PlaceOS::Model::Email | Nil
-
#user_email_will_change! : Nil
Include
#user_email
in the set of changed attributes, whether it has changed or not. -
#user_id : String | Nil
#user_id
getter -
#user_id=(value : String | Nil)
#user_id
setter - #user_id_assigned? : Bool
-
#user_id_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #user_id_changed? : Bool
-
#user_id_default : String | Nil
#user_id
's default value - #user_id_present? : Bool
- #user_id_was : String | Nil | Nil
-
#user_id_will_change! : Nil
Include
#user_id
in the set of changed attributes, whether it has changed or not. -
#user_name : String
#user_name
getter -
#user_name=(value : String)
#user_name
setter -
#user_name? : String | Nil
Assign instance variable to correct type
- #user_name_assigned? : Bool
-
#user_name_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #user_name_changed? : Bool
-
#user_name_default : String
#user_name
's default value - #user_name_present? : Bool
- #user_name_was : String | Nil
-
#user_name_will_change! : Nil
Include
#user_name
in the set of changed attributes, whether it has changed or not. -
#utm_source : String?
Assign instance variable to correct type
-
#utm_source=(value : String | Nil)
#utm_source
setter - #utm_source=(utm_source)
- #utm_source_assigned? : Bool
-
#utm_source_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #utm_source_changed? : Bool
-
#utm_source_default : String | Nil
#utm_source
's default value - #utm_source_present? : Bool
- #utm_source_was : String | Nil | Nil
-
#utm_source_will_change! : Nil
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 : Array(String)
#zones
getter -
#zones=(value : Array(String))
#zones
setter -
#zones? : Array(String) | Nil
Assign instance variable to correct type
- #zones_assigned? : Bool
-
#zones_change : Tuple(Array(String) | Nil, Array(String) | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #zones_changed? : Bool
-
#zones_default : Array(String)
#zones
's default value - #zones_present? : Bool
- #zones_was : Array(String) | Nil
-
#zones_will_change! : Nil
Include
#zones
in the set of changed attributes, whether it has changed or not.
Instance methods inherited from module PlaceOS::Model::Associations
format_list_for_postgres(list : Enumerable(String)) : String
format_list_for_postgres,
reset_associations
reset_associations
Class methods inherited from module PlaceOS::Model::Associations
format_list_for_postgres(list : Enumerable(String)) : String
format_list_for_postgres
Macros inherited from module PlaceOS::Model::Associations
belongs_to(parent_class, dependent = :none, association_name = nil, foreign_key = nil, presence = false, pk_type = nil, serialize = true)
belongs_to,
has_many(child_class, collection_name = nil, dependent = :none, foreign_key = nil, serialize = false)
has_many,
has_one(child_class, dependent = :none, association_name = nil, presence = false)
has_one
Instance methods inherited from class PlaceOS::Model::ModelWithAutoKey
after_create
after_create,
after_destroy
after_destroy,
after_save
after_save,
after_update
after_update,
apply_defaults
apply_defaults,
assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))assign_attributes(model : PlaceOS::Model::ModelWithAutoKey)
assign_attributes assign_attributes, attributes attributes, attributes_tuple attributes_tuple, before_create before_create, before_destroy before_destroy, before_save before_save, before_update before_update, invoke_props invoke_props, persistent_attributes persistent_attributes, run_create_callbacks(&) run_create_callbacks, run_destroy_callbacks(&) run_destroy_callbacks, run_save_callbacks(&) run_save_callbacks, run_update_callbacks(&) run_update_callbacks
Constructor methods inherited from class PlaceOS::Model::ModelWithAutoKey
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)new(pull : JSON::PullParser)
new(rs : DB::ResultSet) new
Class methods inherited from class PlaceOS::Model::ModelWithAutoKey
attributes : Array(Symbol)
attributes,
auto_generate_id : Bool
auto_generate_id,
from_rs(rs : DB::ResultSet)
from_rs,
primary_key : Symbol
primary_key
Constructor Detail
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">
Serialize from a trusted JSON source
Serialize from a trusted YAML source
Initialize PlaceOS::Model::Booking from HTTP::Params
.
Class Method Detail
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
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.
modifies the array, injecting the recurrences ameba:disable Metrics/CyclomaticComplexity
Macro Detail
Instance Method Detail
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #approved_at
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #approved
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #approver_email
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #approver_id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #approver_name
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #asset_id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #asset_ids
in the set of changed attributes, whether it has changed or not.
Assign to multiple attributes.
Assign to mulitple attributes via HTTP::Params
.
Assign to multiple attributes from a model object
Assign each field from JSON if field exists in JSON and has changed in model
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #booked_by_email_digest
in the set of changed attributes, whether it has changed or not.
Include #booked_by_email
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #booked_by_id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #booked_by_name
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
if we want to record the system that performed the bookings (kiosk, mobile, swipe etc)
Include #booked_from
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #booking_end
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #booking_start
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #booking_type
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #checked_in_at
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #checked_in
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #checked_out_at
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #created_at
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #created
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #deleted_at
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #deleted
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #department
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #description
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #email_digest
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #event_id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #extension_data
in the set of changed attributes, whether it has changed or not.
Helper function to find the nth day of a month
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #history
in the set of changed attributes, whether it has changed or not.
Same as #id
but may return nil
when the record hasn't been saved
instead of raising.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #images
in the set of changed attributes, whether it has changed or not.
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #induction
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #instance
in the set of changed attributes, whether it has changed or not.
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #last_changed
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #parent_id
in the set of changed attributes, whether it has changed or not.
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #permission
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
used to hold information relating to the state of the booking process
Include #process_state
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #recurrence_days
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #recurrence_end
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #recurrence_interval
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #recurrence_nth_of_month
in the set of changed attributes, whether it has changed or not.
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #recurrence_type
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #rejected_at
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #rejected
in the set of changed attributes, whether it has changed or not.
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Base class for all models which have auto-generated bigint as pk and doesn't require string based auto generated pk
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #tenant_id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #timezone
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #title
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #updated_at
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #user_email
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #user_id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #user_name
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #utm_source
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed