class

PlaceOS::Model::User

Inherits PlaceOS::Model::Utilities::MetadataHelper < PlaceOS::Model::Timestamps < PlaceOS::Model::ModelBase < PlaceOS::Model::Associations < Neuroplastic < PgORM::Base < PgORM::Validators < PgORM::Table < PgORM::Persistence < PgORM::Associations < ActiveModel::Callbacks < ActiveModel::Validation < ActiveModel::Model < DB::Mappable < DB::Serializable < YAML::Serializable < JSON::Serializable < Reference < Object

Constants

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, :photo_upload_id, :locatable, :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)
PRIMARY_KEY_TYPES = {:id => (String | Nil)} of Nil => Nil

macro level key => type

PRIMARY_KEYS = [{:id}]
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, :photo_upload_id, :locatable]

Constructors

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

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

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

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

Serialize from a trusted JSON source

from_trusted_yaml(string_or_io : String | IO) : self

Serialize from a trusted YAML source

from_yaml(string_or_io : String | IO, trusted : Bool = false) : self
new(rs : DB::ResultSet)
new(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, locatable : 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, logged_out_at : 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, photo_upload_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

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

Class methods

attributes

Returns all attribute keys.

by_authority_id(id)

Look up instances of this model dependent on the foreign key

Source
by_photo_upload_id(id)

Look up instances of this model dependent on the foreign key

Source
changes(id : String | Nil | Nil = nil) : ChangeFeed

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

elastic
find_by_email(authority_id : String, email : PlaceOS::Model::Email | String)
Source
find_by_emails(authority_id : String, emails : Enumerable(String) | Enumerable(Email))
Source
find_by_login_name(authority_id : String, login_name : String)
Source
find_by_login_name(login_name : String)
Source
find_by_staff_id(authority_id : String, staff_id : String)
Source
find_by_staff_id(staff_id : String)
Source
find_sys_admins
Source
from_rs(__temp_2278 : DB::ResultSet)
on_error(err : Exception | IO::Error)
primary_key

Base class for all Engine models

Source
table_name

Instance methods

__authority
__authority=(__authority : Authority | Nil)
__upload
__upload=(__upload : Upload | Nil)
access_token

access_token getter

access_token=(value : String | Nil)

access_token setter

access_token_assigned?
access_token_change

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

access_token_changed?
access_token_default

access_token's default value

Source
access_token_present?
access_token_removed?
access_token_was
access_token_will_change!

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

after_create

Base class for all Engine models

after_destroy

Base class for all Engine models

after_initialize(trusted : Bool)
after_save

Base class for all Engine models

after_update

Base class for all Engine models

api_tokens
Source
apply_defaults

Generate code to apply default values

assign_admin_attributes_from_json(json)

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

  • {{ field.name }} {% end %}
Source
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, locatable : Bool | Missing = Missing, login_count : Int64 | Missing = Missing, last_login : Time | Nil | Missing = Missing, logged_out_at : 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, photo_upload_id : String | Nil | Missing = Missing, id : String | Nil | Missing = Missing)

Assign to multiple attributes.

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

Assign to multiple attributes via HTTP::Params.

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

Assign to multiple attributes from a model object

assign_attributes_from_json(json, root : String)
assign_attributes_from_json(json)

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

Source
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

associated_metadata
Source
attributes

Returns a Hash of all attribute values

attributes_tuple

Returns a NamedTuple of all attribute values.

auth_lookups
Source
authority

Retrieves the parent relationship

Source
authority!
Source
authority=(parent : Authority)

Sets the parent relationship

Source
authority_id

authority_id getter

authority_id=(value : String | Nil)

authority_id setter

authority_id_assigned?
authority_id_change

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

authority_id_changed?
authority_id_default

authority_id's default value

authority_id_present?
authority_id_removed?
authority_id_was
authority_id_will_change!

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

before_create

Base class for all Engine models

before_destroy

Base class for all Engine models

before_save

Base class for all Engine models

before_update

Base class for all Engine models

building

building getter

building=(value : String | Nil)

building setter

building_assigned?
building_change

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

building_changed?
building_default

building's default value

Source
building_present?
building_removed?
building_was
building_will_change!

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

by_authority_id(auth_id : String)
Source
card_number

card_number getter

card_number=(value : String | Nil)

card_number setter

card_number_assigned?
card_number_change

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

card_number_changed?
card_number_default

card_number's default value

Source
card_number_present?
card_number_removed?
card_number_was
card_number_will_change!

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

changed?

Check if any attributes have changed.

changed_attributes

Returns a Hash with all changed attributes.

changed_json(io : IO) : Nil

Serialize the set of changed attributes to JSON.

changed_json

Serialize the set of changed attributes to JSON.

changed_persist_attributes
changed_yaml(io : IO) : Nil

Serialize the set of changed attributes to YAML.

changed_yaml

Serialize the set of changed attributes to YAML.

clear_changes_information

Reset changes for all attributes.

country

country getter

country=(value : String | Nil)

country setter

country_assigned?
country_change

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

country_changed?
country_default

country's default value

Source
country_present?
country_removed?
country_was
country_will_change!

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

created_at

created_at getter

created_at=(value : Time)

Setters created_at setter

created_at?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

created_at_assigned?
created_at_change

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

created_at_changed?
created_at_default

created_at's default value

created_at_present?
created_at_removed?
created_at_was
created_at_will_change!

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

deleted

deleted getter

deleted=(value : Bool)

deleted setter

deleted?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

deleted_assigned?
deleted_change

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

deleted_changed?
deleted_default

deleted's default value

Source
deleted_present?
deleted_removed?
deleted_was
deleted_will_change!

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

department

department getter

department=(value : String | Nil)

department setter

department_assigned?
department_change

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

department_changed?
department_default

department's default value

Source
department_present?
department_removed?
department_was
department_will_change!

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

destroy

Destroys the record, running callbacks and updating associations.

This is the "safe" way to delete records as it:

  • Runs before_destroy and after_destroy callbacks
  • Handles dependent associations (nullify, delete, destroy)
  • Wraps everything in a transaction

Example

user = User.find(1)
user.destroy
user.destroyed? # => true
user.persisted? # => false

Returns self (even if already destroyed or new).

Source
destroy_api_tokens
destroy_auth_lookups
destroy_metadata_and_versions

Metadata belonging to this user

email

email getter

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

email setter

email?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

email_assigned?
email_change

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

email_changed?
email_default

email's default value

Source
email_digest

email_digest getter

email_digest=(value : String | Nil)

email_digest setter

email_digest_assigned?
email_digest_change

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

email_digest_changed?
email_digest_default

email_digest's default value

Source
email_digest_present?
email_digest_removed?
email_digest_was
email_digest_will_change!

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

email_present?
email_removed?
email_was
email_will_change!

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

expires

expires getter

expires=(value : Bool)

expires setter

expires?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

expires_assigned?
expires_at

expires_at getter

expires_at=(value : Int64 | Nil)

expires_at setter

expires_at_assigned?
expires_at_change

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

expires_at_changed?
expires_at_default

expires_at's default value

Source
expires_at_present?
expires_at_removed?
expires_at_was
expires_at_will_change!

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

expires_change

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

expires_changed?
expires_default

expires's default value

Source
expires_present?
expires_removed?
expires_was
expires_will_change!

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

first_name

first_name getter

first_name=(value : String | Nil)

first_name setter

first_name_assigned?
first_name_change

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

first_name_changed?
first_name_default

first_name's default value

Source
first_name_present?
first_name_removed?
first_name_was
first_name_will_change!

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

groups

groups getter

groups=(value : Array(String))

groups setter

groups?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

groups_assigned?
groups_change

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

groups_changed?
groups_default

groups's default value

Source
groups_present?
groups_removed?
groups_was
groups_will_change!

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

id

id getter

id=(value : String | Nil)

id setter

id?
id_assigned?
id_change

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

id_changed?
id_default

id's default value

id_present?
id_removed?
id_was
id_will_change!

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

image

image getter

image=(value : String | Nil)

image setter

image_assigned?
image_change

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

image_changed?
image_default

image's default value

Source
image_present?
image_removed?
image_was
image_will_change!

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

invoke_props

Base class for all Engine models

is_admin?
Source
is_support?
Source
last_login

last_login getter

last_login=(value : Time | Nil)

last_login setter

last_login_assigned?
last_login_change

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

last_login_changed?
last_login_default

last_login's default value

Source
last_login_present?
last_login_removed?
last_login_was
last_login_will_change!

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

last_name

last_name getter

last_name=(value : String | Nil)

last_name setter

last_name_assigned?
last_name_change

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

last_name_changed?
last_name_default

last_name's default value

Source
last_name_present?
last_name_removed?
last_name_was
last_name_will_change!

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

locatable

locatable getter

locatable=(value : Bool)

locatable setter

locatable?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

locatable_assigned?
locatable_change

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

locatable_changed?
locatable_default

locatable's default value

Source
locatable_present?
locatable_removed?
locatable_was
locatable_will_change!

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

logged_out_at

logged_out_at getter

logged_out_at=(value : Time | Nil)

logged_out_at setter

logged_out_at_assigned?
logged_out_at_change

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

logged_out_at_changed?
logged_out_at_default

logged_out_at's default value

Source
logged_out_at_present?
logged_out_at_removed?
logged_out_at_was
logged_out_at_will_change!

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

login_count

login_count getter

login_count=(value : Int64)

login_count setter

login_count?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

login_count_assigned?
login_count_change

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

login_count_changed?
login_count_default

login_count's default value

Source
login_count_present?
login_count_removed?
login_count_was
login_count_will_change!

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

login_name

login_name getter

login_name=(value : String | Nil)

login_name setter

login_name_assigned?
login_name_change

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

login_name_changed?
login_name_default

login_name's default value

Source
login_name_present?
login_name_removed?
login_name_was
login_name_will_change!

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

metadata_and_versions

Metadata belonging to this user

Source
misc

misc getter

misc=(value : String | Nil)

misc setter

misc_assigned?
misc_change

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

misc_changed?
misc_default

misc's default value

Source
misc_present?
misc_removed?
misc_was
misc_will_change!

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

name

name getter

name=(value : String)

name setter

name?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

name_assigned?
name_change

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

name_changed?
name_default

name's default value

Source
name_present?
name_removed?
name_was
name_will_change!

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

nickname

nickname getter

nickname=(value : String | Nil)

nickname setter

nickname_assigned?
nickname_change

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

nickname_changed?
nickname_default

nickname's default value

Source
nickname_present?
nickname_removed?
nickname_was
nickname_will_change!

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

password

password getter

password=(new_password : String) : String
Source
password=(value : String | Nil)

password setter

password_assigned?
password_change

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

password_changed?
password_default

password's default value

Source
password_digest

password_digest getter

password_digest=(value : String | Nil)

password_digest setter

password_digest_assigned?
password_digest_change

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

password_digest_changed?
password_digest_default

password_digest's default value

Source
password_digest_present?
password_digest_removed?
password_digest_was
password_digest_will_change!

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

password_present?
password_removed?
password_was
password_will_change!

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

persistent_attributes

Returns a Hash of all attributes that can be persisted.

phone

phone getter

phone=(value : String | Nil)

phone setter

phone_assigned?
phone_change

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

phone_changed?
phone_default

phone's default value

Source
phone_present?
phone_removed?
phone_was
phone_will_change!

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

photo_upload_id

photo_upload_id getter

photo_upload_id=(value : String | Nil)

photo_upload_id setter

photo_upload_id_assigned?
photo_upload_id_change

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

photo_upload_id_changed?
photo_upload_id_default

photo_upload_id's default value

photo_upload_id_present?
photo_upload_id_removed?
photo_upload_id_was
photo_upload_id_will_change!

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

preferred_language

preferred_language getter

preferred_language=(value : String | Nil)

preferred_language setter

preferred_language_assigned?
preferred_language_change

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

preferred_language_changed?
preferred_language_default

preferred_language's default value

Source
preferred_language_present?
preferred_language_removed?
preferred_language_was
preferred_language_will_change!

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

primary_key

Base class for all Engine models

Source
primary_key_hash
refresh_token

refresh_token getter

refresh_token=(value : String | Nil)

refresh_token setter

refresh_token_assigned?
refresh_token_change

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

refresh_token_changed?
refresh_token_default

refresh_token's default value

Source
refresh_token_present?
refresh_token_removed?
refresh_token_was
refresh_token_will_change!

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

reset_associations
Source
restore_attributes

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

staff_id

staff_id getter

staff_id=(value : String | Nil)

staff_id setter

staff_id_assigned?
staff_id_change

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

staff_id_changed?
staff_id_default

staff_id's default value

Source
staff_id_present?
staff_id_removed?
staff_id_was
staff_id_will_change!

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

subsystem_access

Unique subsystem codes the user has effective access to via group membership.

A user is effectively a member of every descendant of any group they have an explicit GroupUser row on (closest-ancestor-wins semantics, same as Group.resolve_user_permissions). The subsystem access for the user is the union of groups.subsystems across every such reachable group, scoped to the user's authority.

Implemented as a single recursive CTE so the cost is independent of tree depth or member count.

Source
support

support getter

support=(value : Bool)

support setter

support?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

support_assigned?
support_change

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

support_changed?
support_default

support's default value

Source
support_present?
support_removed?
support_was
support_will_change!

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

sys_admin

sys_admin getter

sys_admin=(value : Bool)

sys_admin setter

sys_admin?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

sys_admin_assigned?
sys_admin_change

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

sys_admin_changed?
sys_admin_default

sys_admin's default value

Source
sys_admin_present?
sys_admin_removed?
sys_admin_was
sys_admin_will_change!

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

table_name
to_admin_json(json : JSON::Builder)

Serialize attributes with :admin in its serialization_group option

to_admin_json(io : IO) : Nil

Serialize attributes with :admin in its serialization_group option

to_admin_json

Serialize attributes with :admin in its serialization_group option

to_admin_metadata_json(json : JSON::Builder)

Serialize attributes with :admin_metadata in its serialization_group option

to_admin_metadata_json(io : IO) : Nil

Serialize attributes with :admin_metadata in its serialization_group option

to_admin_metadata_json

Serialize attributes with :admin_metadata in its serialization_group option

to_admin_metadata_struct
to_admin_struct
to_group_json(json : JSON::Builder)

Serialize attributes with :group in its serialization_group option

to_group_json(io : IO) : Nil

Serialize attributes with :group in its serialization_group option

to_group_json

Serialize attributes with :group in its serialization_group option

to_group_struct
to_jwt_permission
Source
to_public_json(json : JSON::Builder)

Serialize attributes with :public in its serialization_group option

to_public_json(io : IO) : Nil

Serialize attributes with :public in its serialization_group option

to_public_json

Serialize attributes with :public in its serialization_group option

to_public_metadata_json(json : JSON::Builder)

Serialize attributes with :public_metadata in its serialization_group option

to_public_metadata_json(io : IO) : Nil

Serialize attributes with :public_metadata in its serialization_group option

to_public_metadata_json

Serialize attributes with :public_metadata in its serialization_group option

to_public_metadata_struct
to_public_struct
ui_theme

ui_theme getter

ui_theme=(value : String | Nil)

ui_theme setter

ui_theme_assigned?
ui_theme_change

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

ui_theme_changed?
ui_theme_default

ui_theme's default value

Source
ui_theme_present?
ui_theme_removed?
ui_theme_was
ui_theme_will_change!

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

updated_at

updated_at getter

updated_at=(value : Time)

updated_at setter

updated_at?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

updated_at_assigned?
updated_at_change

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

updated_at_changed?
updated_at_default

updated_at's default value

updated_at_present?
updated_at_removed?
updated_at_was
updated_at_will_change!

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

upload

Retrieves the parent relationship

Source
upload!
Source
upload=(parent : Upload)

Sets the parent relationship

Source
validate_nilability

Validate that all non-nillable fields have values.

work_overrides

work_overrides getter

work_overrides setter

work_overrides?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

work_overrides_assigned?
work_overrides_change

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

work_overrides_changed?
work_overrides_default

work_overrides's default value

Source
work_overrides_present?
work_overrides_removed?
work_overrides_was
work_overrides_will_change!

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

work_preferences

work_preferences getter

work_preferences setter

work_preferences?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

work_preferences_assigned?
work_preferences_change

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

work_preferences_changed?
work_preferences_default

work_preferences's default value

Source
work_preferences_present?
work_preferences_removed?
work_preferences_was
work_preferences_will_change!

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

Nested types