class PlaceOS::Model::User

Included Modules

Defined in:

placeos-models/user.cr

Constant Summary

ADMIN_DATA = [:email_digest, :email, :nickname, :name, :first_name, :last_name, :groups, :country, :building, :image, :created_at, :authority_id, :deleted, :department, :preferred_language, :staff_id, :phone, :work_preferences, :work_overrides, :login_count, :last_login, :sys_admin, :support, :misc, :login_name, :card_number, :ui_theme]
CALLBACKS = {before_save: [:build_name, :write_email_fields, do if pass = @password if pass.empty? @password_digest = nil else digest = Password.create(pass) self.password_digest = digest.to_s end end @password = nil end] of Nil, after_save: [] of Nil, before_create: [do self.created_at = self.updated_at = Time.utc end] of Nil, after_create: [] of Nil, before_update: [do self.updated_at = Time.utc end] of Nil, after_update: [] of Nil, before_destroy: [:destroy_auth_lookups, :destroy_metadata_and_versions, :destroy_api_tokens, :ensure_admin_remains, :cleanup_auth_tokens] of Nil, after_destroy: [] of Nil}
Log = ::Log.for(self)
PUBLIC_DATA = [:email_digest, :email, :nickname, :name, :first_name, :last_name, :groups, :country, :building, :image, :created_at, :authority_id, :deleted, :department, :preferred_language, :staff_id, :phone, :work_preferences, :work_overrides, :login_count, :last_login]

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module PlaceOS::Model::Utilities::MetadataHelper

metadata(name : String | Nil = nil) : Array(Metadata) metadata

Instance methods inherited from class PlaceOS::Model::ModelBase

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::ModelBase)
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::ModelBase

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
new(pull : JSON::PullParser)
new(rs : DB::ResultSet)
new

Class methods inherited from class PlaceOS::Model::ModelBase

attributes : Array(Symbol) attributes, auto_generate_id : Bool auto_generate_id, from_rs(rs : DB::ResultSet) from_rs, primary_key : Symbol primary_key

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

Constructor Detail

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

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

Deserializes the given JSON in string_or_io into an instance of self, assuming the JSON consists of an JSON object with key root, and whose value is the value to deserialize. Will not deserialise from fields with mass_assign: false

class User < ActiveModel::Model
  attribute name : String
  attribute google_id : UUID, mass_assign: false
end

User.from_json(%({"main": {"name": "Jason", "google_id": "f6f70bfb-c882-446d-8758-7ce47db39620"}}), root: "main") # => #<User:0x103131b20 @name="Jason">

def self.from_trusted_json(string_or_io : String | IO, root : String) : self #

def self.from_trusted_json(string_or_io : String | IO) : self #

Serialize from a trusted JSON source


def self.from_trusted_yaml(string_or_io : String | IO) : self #

Serialize from a trusted YAML source


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

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

def self.new(pull : JSON::PullParser) #

def self.new(rs : DB::ResultSet) #

def self.new(created_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, updated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, name : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, nickname : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, email : PlaceOS::Model::Email | ActiveModel::Model::None = ::ActiveModel::Model::None.new, phone : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, country : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, image : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, ui_theme : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, misc : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, login_name : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, staff_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, first_name : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, last_name : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, building : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, department : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, preferred_language : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, password_digest : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, email_digest : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, card_number : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, deleted : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, groups : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, access_token : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, refresh_token : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, expires_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, expires : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, password : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, sys_admin : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, support : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, login_count : Int64 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, last_login : Time | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, work_preferences : Array(PlaceOS::Model::User::WorktimePreference) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, work_overrides : Hash(String, PlaceOS::Model::User::WorktimePreference) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, authority_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new) #

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

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


Class Method Detail

def self.attributes : Array(Symbol) #

Returns all attribute keys.


def self.auto_generate_id : Bool #

def self.by_authority_id(id) #

Look up instances of this model dependent on the foreign key


def self.changes(id : PrimaryKeyType = nil) : ChangeFeed #

Changefeed at row (if #id passed) or whole table level. Returns a ChangeFeed instance which can be used to invoke async callbacks via on or use blocking Iterator via each method.


def self.elastic #

def self.find_by_email(authority_id : String, email : PlaceOS::Model::Email | String) #

def self.find_by_emails(authority_id : String, emails : Enumerable(String) | Enumerable(Email)) #

def self.find_by_login_name(authority_id : String, login_name : String) #

def self.find_by_login_name(login_name : String) #

def self.find_by_staff_id(authority_id : String, staff_id : String) #

def self.find_by_staff_id(staff_id : String) #

def self.find_sys_admins #

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

def self.on_error(err : Exception | IO::Error) #

def self.primary_key : Symbol #

def self.table_name #

Instance Method Detail

def __authority : Authority | Nil #

def __authority=(__authority : Authority | Nil) #

def access_token : String | Nil #

#access_token getter


def access_token=(value : String | Nil) #

#access_token setter


def access_token_assigned? : Bool #

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

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


def access_token_changed? : Bool #

def access_token_default : String | Nil #

#access_token's default value


def access_token_present? : Bool #

def access_token_was : String | Nil | Nil #

def access_token_will_change! : Nil #

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


def after_create #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def after_destroy #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def after_initialize(trusted : Bool) #

def after_save #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def after_update #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def api_tokens #

def apply_defaults #

Generate code to apply default values


def assign_admin_attributes_from_json(json) #

Sets sensitve admin attributes restricted from mass assigment. Handles.. {% for field in AdminAttributes.instance_vars %}

  • {{ field.name }} {% end %}

def assign_attributes(created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing, name : String | Missing = Missing, nickname : String | Nil | Missing = Missing, email : PlaceOS::Model::Email | Missing = Missing, phone : String | Nil | Missing = Missing, country : String | Nil | Missing = Missing, image : String | Nil | Missing = Missing, ui_theme : String | Nil | Missing = Missing, misc : String | Nil | Missing = Missing, login_name : String | Nil | Missing = Missing, staff_id : String | Nil | Missing = Missing, first_name : String | Nil | Missing = Missing, last_name : String | Nil | Missing = Missing, building : String | Nil | Missing = Missing, department : String | Nil | Missing = Missing, preferred_language : String | Nil | Missing = Missing, password_digest : String | Nil | Missing = Missing, email_digest : String | Nil | Missing = Missing, card_number : String | Nil | Missing = Missing, deleted : Bool | Missing = Missing, groups : Array(String) | Missing = Missing, access_token : String | Nil | Missing = Missing, refresh_token : String | Nil | Missing = Missing, expires_at : Int64 | Nil | Missing = Missing, expires : Bool | Missing = Missing, password : String | Nil | Missing = Missing, sys_admin : Bool | Missing = Missing, support : Bool | Missing = Missing, login_count : Int64 | Missing = Missing, last_login : Time | Nil | Missing = Missing, work_preferences : Array(PlaceOS::Model::User::WorktimePreference) | Missing = Missing, work_overrides : Hash(String, PlaceOS::Model::User::WorktimePreference) | Missing = Missing, authority_id : String | Nil | Missing = Missing, id : String | Nil | Missing = Missing) #

Assign to multiple attributes.


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

Assign to mulitple attributes via HTTP::Params.


def assign_attributes(model : PlaceOS::Model::User) #

Assign to multiple attributes from a model object


def assign_attributes_from_json(json, root : String) #

def assign_attributes_from_json(json) #

Ensure the PlaceOS::Model::User's PlaceOS::Model::Authority doesn't change


def assign_attributes_from_trusted_json(json, root : String) #

def assign_attributes_from_trusted_json(json) #

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


def assign_attributes_from_trusted_yaml(yaml) #

def assign_attributes_from_yaml(yaml) #

Uses the YAML parser as JSON is valid YAML


def associated_metadata #

def attributes #

Returns a Hash of all attribute values


def attributes_tuple #

Returns a NamedTuple of all attribute values.


def auth_lookups #

def authority : Authority | Nil #

Retrieves the parent relationship


def authority! : Authority #

def authority=(parent : Authority) #

Sets the parent relationship


def authority_id : String | Nil #

#authority_id getter


def authority_id=(value : String | Nil) #

#authority_id setter


def authority_id_assigned? : Bool #

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

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


def authority_id_changed? : Bool #

def authority_id_default : String | Nil #

#authority_id's default value


def authority_id_present? : Bool #

def authority_id_was : String | Nil | Nil #

def authority_id_will_change! : Nil #

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


def before_create #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def before_destroy #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def before_save #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def before_update #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def building : String | Nil #

#building getter


def building=(value : String | Nil) #

#building setter


def building_assigned? : Bool #

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

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


def building_changed? : Bool #

def building_default : String | Nil #

#building's default value


def building_present? : Bool #

def building_was : String | Nil | Nil #

def building_will_change! : Nil #

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


def by_authority_id(auth_id : String) #

def card_number : String | Nil #

#card_number getter


def card_number=(value : String | Nil) #

#card_number setter


def card_number_assigned? : Bool #

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

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


def card_number_changed? : Bool #

def card_number_default : String | Nil #

#card_number's default value


def card_number_present? : Bool #

def card_number_was : String | Nil | Nil #

def card_number_will_change! : Nil #

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


def changed? #

Check if any attributes have changed.


def changed_attributes #

Returns a Hash with all changed attributes.


def changed_json(io : IO) : Nil #

Serialize the set of changed attributes to JSON.


def changed_json : String #

Serialize the set of changed attributes to JSON.


def changed_persist_attributes #

def changed_yaml(io : IO) : Nil #

Serialize the set of changed attributes to YAML.


def changed_yaml : String #

Serialize the set of changed attributes to YAML.


def clear_changes_information #

Reset changes for all attributes.


def country : String | Nil #

#country getter


def country=(value : String | Nil) #

#country setter


def country_assigned? : Bool #

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

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


def country_changed? : Bool #

def country_default : String | Nil #

#country's default value


def country_present? : Bool #

def country_was : String | Nil | Nil #

def country_will_change! : Nil #

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


def created_at : Time #

#created_at getter


def created_at=(value : Time) #

Setters #created_at setter


def created_at? : Time | Nil #

def created_at_assigned? : Bool #

def created_at_change : Tuple(Time | Nil, Time | Nil) | Nil #

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


def created_at_changed? : Bool #

def created_at_default : Time #

#created_at's default value


def created_at_present? : Bool #

def created_at_was : Time | Nil #

def created_at_will_change! : Nil #

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


def deleted : Bool #

#deleted getter


def deleted=(value : Bool) #

#deleted setter


def deleted? : Bool | Nil #

def deleted_assigned? : Bool #

def 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


def deleted_changed? : Bool #

def deleted_default : Bool #

#deleted's default value


def deleted_present? : Bool #

def deleted_was : Bool | Nil #

def deleted_will_change! : Nil #

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


def department : String | Nil #

#department getter


def department=(value : String | Nil) #

#department setter


def department_assigned? : Bool #

def 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


def department_changed? : Bool #

def department_default : String | Nil #

#department's default value


def department_present? : Bool #

def department_was : String | Nil | Nil #

def department_will_change! : Nil #

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


def destroy #

Destroy object, run destroy callbacks and update associations


def destroy_api_tokens #

def destroy_auth_lookups #

def destroy_metadata_and_versions #

Metadata belonging to this user


def email : PlaceOS::Model::Email #

#email getter


def email=(value : PlaceOS::Model::Email) #

#email setter


def email? : PlaceOS::Model::Email | Nil #

def email_assigned? : Bool #

def 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


def email_changed? : Bool #

def email_default : Email #

#email's default value


def email_digest : String | Nil #

#email_digest getter


def email_digest=(value : String | Nil) #

#email_digest setter


def email_digest_assigned? : Bool #

def 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


def email_digest_changed? : Bool #

def email_digest_default : String | Nil #

#email_digest's default value


def email_digest_present? : Bool #

def email_digest_was : String | Nil | Nil #

def email_digest_will_change! : Nil #

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


def email_present? : Bool #

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

def email_will_change! : Nil #

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


def expires : Bool #

#expires getter


def expires=(value : Bool) #

#expires setter


def expires? : Bool | Nil #

def expires_assigned? : Bool #

def expires_at : Int64 | Nil #

#expires_at getter


def expires_at=(value : Int64 | Nil) #

#expires_at setter


def expires_at_assigned? : Bool #

def expires_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


def expires_at_changed? : Bool #

def expires_at_default : Int64 | Nil #

#expires_at's default value


def expires_at_present? : Bool #

def expires_at_was : Int64 | Nil | Nil #

def expires_at_will_change! : Nil #

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


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

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


def expires_changed? : Bool #

def expires_default : Bool #

#expires's default value


def expires_present? : Bool #

def expires_was : Bool | Nil #

def expires_will_change! : Nil #

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


def first_name : String | Nil #

#first_name getter


def first_name=(value : String | Nil) #

#first_name setter


def first_name_assigned? : Bool #

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

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


def first_name_changed? : Bool #

def first_name_default : String | Nil #

#first_name's default value


def first_name_present? : Bool #

def first_name_was : String | Nil | Nil #

def first_name_will_change! : Nil #

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


def groups : Array(String) #

#groups getter


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

#groups setter


def groups? : Array(String) | Nil #

def groups_assigned? : Bool #

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

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


def groups_changed? : Bool #

def groups_default : Array(String) #

#groups's default value


def groups_present? : Bool #

def groups_was : Array(String) | Nil #

def groups_will_change! : Nil #

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


def id : String | Nil #

#id getter


def id=(value : String | Nil) #

#id setter


def id? : String | Nil | Nil #
Description copied from class PgORM::Base

Same as #id but may return nil when the record hasn't been saved instead of raising.


def id_assigned? : Bool #

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

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


def id_changed? : Bool #

def id_default : String | Nil #

#id's default value


def id_present? : Bool #

def id_was : String | Nil | Nil #

def id_will_change! : Nil #

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


def image : String | Nil #

#image getter


def image=(value : String | Nil) #

#image setter


def image_assigned? : Bool #

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

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


def image_changed? : Bool #

def image_default : String | Nil #

#image's default value


def image_present? : Bool #

def image_was : String | Nil | Nil #

def image_will_change! : Nil #

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


def invoke_props #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def is_admin? #

def is_support? #

def last_login : Time | Nil #

#last_login getter


def last_login=(value : Time | Nil) #

#last_login setter


def last_login_assigned? : Bool #

def last_login_change : Tuple(Time | Nil | Nil, Time | Nil | Nil) | Nil #

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


def last_login_changed? : Bool #

def last_login_default : Time | Nil #

#last_login's default value


def last_login_present? : Bool #

def last_login_was : Time | Nil | Nil #

def last_login_will_change! : Nil #

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


def last_name : String | Nil #

#last_name getter


def last_name=(value : String | Nil) #

#last_name setter


def last_name_assigned? : Bool #

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

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


def last_name_changed? : Bool #

def last_name_default : String | Nil #

#last_name's default value


def last_name_present? : Bool #

def last_name_was : String | Nil | Nil #

def last_name_will_change! : Nil #

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


def login_count : Int64 #

#login_count getter


def login_count=(value : Int64) #

#login_count setter


def login_count? : Int64 | Nil #

def login_count_assigned? : Bool #

def login_count_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


def login_count_changed? : Bool #

def login_count_default : Int64 #

#login_count's default value


def login_count_present? : Bool #

def login_count_was : Int64 | Nil #

def login_count_will_change! : Nil #

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


def login_name : String | Nil #

#login_name getter


def login_name=(value : String | Nil) #

#login_name setter


def login_name_assigned? : Bool #

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

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


def login_name_changed? : Bool #

def login_name_default : String | Nil #

#login_name's default value


def login_name_present? : Bool #

def login_name_was : String | Nil | Nil #

def login_name_will_change! : Nil #

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


def metadata_and_versions #

Metadata belonging to this user


def misc : String | Nil #

#misc getter


def misc=(value : String | Nil) #

#misc setter


def misc_assigned? : Bool #

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

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


def misc_changed? : Bool #

def misc_default : String | Nil #

#misc's default value


def misc_present? : Bool #

def misc_was : String | Nil | Nil #

def misc_will_change! : Nil #

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


def name : String #

#name getter


def name=(value : String) #

#name setter


def name? : String | Nil #

def name_assigned? : Bool #

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

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


def name_changed? : Bool #

def name_default : String #

#name's default value


def name_present? : Bool #

def name_was : String | Nil #

def name_will_change! : Nil #

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


def nickname : String | Nil #

#nickname getter


def nickname=(value : String | Nil) #

#nickname setter


def nickname_assigned? : Bool #

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

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


def nickname_changed? : Bool #

def nickname_default : String | Nil #

#nickname's default value


def nickname_present? : Bool #

def nickname_was : String | Nil | Nil #

def nickname_will_change! : Nil #

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


def password : String | Nil #

#password getter


def password=(new_password : String) : String #

def password=(value : String | Nil) #

#password setter


def password_assigned? : Bool #

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

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


def password_changed? : Bool #

def password_default : String | Nil #

#password's default value


def password_digest : String | Nil #

def password_digest=(value : String | Nil) #

def password_digest_assigned? : Bool #

def password_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


def password_digest_changed? : Bool #

def password_digest_default : String | Nil #

#password_digest's default value


def password_digest_present? : Bool #

def password_digest_was : String | Nil | Nil #

def password_digest_will_change! : Nil #

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


def password_present? : Bool #

def password_was : String | Nil | Nil #

def password_will_change! : Nil #

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


def persistent_attributes #

Returns a Hash of all attributes that can be persisted.


def phone : String | Nil #

#phone getter


def phone=(value : String | Nil) #

#phone setter


def phone_assigned? : Bool #

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

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


def phone_changed? : Bool #

def phone_default : String | Nil #

#phone's default value


def phone_present? : Bool #

def phone_was : String | Nil | Nil #

def phone_will_change! : Nil #

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


def preferred_language : String | Nil #

def preferred_language=(value : String | Nil) #

def preferred_language_assigned? : Bool #

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

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


def preferred_language_changed? : Bool #

def preferred_language_default : String | Nil #

#preferred_language's default value


def preferred_language_present? : Bool #

def preferred_language_was : String | Nil | Nil #

def preferred_language_will_change! : Nil #

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


def refresh_token : String | Nil #

def refresh_token=(value : String | Nil) #

def refresh_token_assigned? : Bool #

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

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


def refresh_token_changed? : Bool #

def refresh_token_default : String | Nil #

#refresh_token's default value


def refresh_token_present? : Bool #

def refresh_token_was : String | Nil | Nil #

def refresh_token_will_change! : Nil #

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


def reset_associations #

def restore_attributes #

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


def run_create_callbacks(&) #

Wrap a block with callbacks for the appropriate crud operation


def run_destroy_callbacks(&) #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def run_save_callbacks(&) #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def run_update_callbacks(&) #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def staff_id : String | Nil #

#staff_id getter


def staff_id=(value : String | Nil) #

#staff_id setter


def staff_id_assigned? : Bool #

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

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


def staff_id_changed? : Bool #

def staff_id_default : String | Nil #

#staff_id's default value


def staff_id_present? : Bool #

def staff_id_was : String | Nil | Nil #

def staff_id_will_change! : Nil #

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


def support : Bool #

#support getter


def support=(value : Bool) #

#support setter


def support? : Bool | Nil #

def support_assigned? : Bool #

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

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


def support_changed? : Bool #

def support_default : Bool #

#support's default value


def support_present? : Bool #

def support_was : Bool | Nil #

def support_will_change! : Nil #

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


def sys_admin : Bool #

#sys_admin getter


def sys_admin=(value : Bool) #

#sys_admin setter


def sys_admin? : Bool | Nil #

def sys_admin_assigned? : Bool #

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

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


def sys_admin_changed? : Bool #

def sys_admin_default : Bool #

#sys_admin's default value


def sys_admin_present? : Bool #

def sys_admin_was : Bool | Nil #

def sys_admin_will_change! : Nil #

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


def table_name #

def to_admin_json(json : JSON::Builder) #

Serialize attributes with :admin in its serialization_group option


def to_admin_json(io : IO) : Nil #

Serialize attributes with :admin in its serialization_group option


def to_admin_json : String #

Serialize attributes with :admin in its serialization_group option


def to_admin_metadata_json(json : JSON::Builder) #

Serialize attributes with :admin_metadata in its serialization_group option


def to_admin_metadata_json(io : IO) : Nil #

Serialize attributes with :admin_metadata in its serialization_group option


def to_admin_metadata_json : String #

Serialize attributes with :admin_metadata in its serialization_group option


def to_admin_metadata_struct #

def to_admin_struct #

def to_group_json(json : JSON::Builder) #

Serialize attributes with :group in its serialization_group option


def to_group_json(io : IO) : Nil #

Serialize attributes with :group in its serialization_group option


def to_group_json : String #

Serialize attributes with :group in its serialization_group option


def to_group_struct #

def to_jwt_permission : UserJWT::Permissions #

def to_public_json(json : JSON::Builder) #

Serialize attributes with :public in its serialization_group option


def to_public_json(io : IO) : Nil #

Serialize attributes with :public in its serialization_group option


def to_public_json : String #

Serialize attributes with :public in its serialization_group option


def to_public_metadata_json(json : JSON::Builder) #

Serialize attributes with :public_metadata in its serialization_group option


def to_public_metadata_json(io : IO) : Nil #

Serialize attributes with :public_metadata in its serialization_group option


def to_public_metadata_json : String #

Serialize attributes with :public_metadata in its serialization_group option


def to_public_metadata_struct #

def to_public_struct #

def ui_theme : String | Nil #

#ui_theme getter


def ui_theme=(value : String | Nil) #

#ui_theme setter


def ui_theme_assigned? : Bool #

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

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


def ui_theme_changed? : Bool #

def ui_theme_default : String | Nil #

#ui_theme's default value


def ui_theme_present? : Bool #

def ui_theme_was : String | Nil | Nil #

def ui_theme_will_change! : Nil #

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


def updated_at : Time #

#updated_at getter


def updated_at=(value : Time) #

#updated_at setter


def updated_at? : Time | Nil #

def updated_at_assigned? : Bool #

def updated_at_change : Tuple(Time | Nil, Time | Nil) | Nil #

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


def updated_at_changed? : Bool #

def updated_at_default : Time #

#updated_at's default value


def updated_at_present? : Bool #

def updated_at_was : Time | Nil #

def updated_at_will_change! : Nil #

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


def validate_nilability #

Validate that all non-nillable fields have values.


def work_overrides : Hash(String, PlaceOS::Model::User::WorktimePreference) #

def work_overrides=(value : Hash(String, PlaceOS::Model::User::WorktimePreference)) #

def work_overrides? : Hash(String, PlaceOS::Model::User::WorktimePreference) | Nil #

def work_overrides_assigned? : Bool #

def work_overrides_change : Tuple(Hash(String, PlaceOS::Model::User::WorktimePreference) | Nil, Hash(String, PlaceOS::Model::User::WorktimePreference) | Nil) | Nil #

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


def work_overrides_changed? : Bool #

def work_overrides_default : Hash(String, WorktimePreference) #

#work_overrides's default value


def work_overrides_present? : Bool #

def work_overrides_was : Hash(String, PlaceOS::Model::User::WorktimePreference) | Nil #

def work_overrides_will_change! : Nil #

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


def work_preferences : Array(PlaceOS::Model::User::WorktimePreference) #

def work_preferences=(value : Array(PlaceOS::Model::User::WorktimePreference)) #

def work_preferences? : Array(PlaceOS::Model::User::WorktimePreference) | Nil #

def work_preferences_assigned? : Bool #

def work_preferences_change : Tuple(Array(PlaceOS::Model::User::WorktimePreference) | Nil, Array(PlaceOS::Model::User::WorktimePreference) | Nil) | Nil #

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


def work_preferences_changed? : Bool #

def work_preferences_default : Array(WorktimePreference) #

#work_preferences's default value


def work_preferences_present? : Bool #

def work_preferences_was : Array(PlaceOS::Model::User::WorktimePreference) | Nil #

def work_preferences_will_change! : Nil #

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