class

PlaceOS::Model::Group

Inherits PlaceOS::Model::GroupHistory::Mixin < PgORM::Timestamps < 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

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

Constants

CALLBACKS = { before_save: [do if (__temp_1180 = @authority) && __temp_1180.new_record? __temp_1180.save self.authority_id = __temp_1180.id.not_nil! end end, do if (__temp_1181 = @parent) && __temp_1181.new_record? __temp_1181.save self.parent_id = __temp_1181.id.not_nil! end end, :capture_history_state] of Nil, after_save: [:record_history_save] of Nil, before_create: [do self.created_at = self.updated_at = Time.utc end] of Nil, after_create: [] of Nil, before_update: [do self.updated_at = Time.utc end] of Nil, after_update: [] of Nil, before_destroy: [] of Nil, after_destroy: [do end, do end, :record_history_destroy] of Nil, }

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

PRIMARY_KEY_TYPES = {:id => UUID} of Nil => Nil

macro level key => type

PRIMARY_KEYS = [{:id}]

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

Constructors

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

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

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

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

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

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

Source
new(pull : JSON::PullParser)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

Source
new(rs : DB::ResultSet)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

new(created_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, updated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : UUID | ActiveModel::Model::None = ::ActiveModel::Model::None.new, name : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, description : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, subsystems : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, authority_id : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, parent_id : UUID | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

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

Class methods

accessible_zone_ids(authority_id : String, subsystem : String, user_id : String) : Array(String)

Zone ids this user has any non-zero effective permission on, within subsystem. Includes zones reached transitively (via ancestor group membership and via ancestor zone GroupZone rows), minus anything masked off by deny rows.

Source
accessible_zones_sql(authority_id : String, subsystems : Array(String), user_id : String, required : Permissions) : String | Nil

Returns a self-contained SQL subquery (single column: zone id) yielding every zone where the user's effective permissions within any of subsystems satisfy required (Manage is a superset). The same rules as resolve_subsystem_permissions apply, but only the anchor-level grant decisions are made in Crystal (bounded by the explicit GroupUser / GroupZone rows) — the zone-subtree expansion runs in the database via a recursive CTE, so the qualifying zone set is never materialised in application memory. Returns nil when the user holds no qualifying grants (callers should treat nil as an empty set).

Source
attributes

Returns all attribute keys.

by_authority_id(id)
Source
by_parent_id(id)
Source
changes(id : UUID | 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.

effective_permissions(authority_id : String, subsystem : String, user_id : String, zone_id : String) : Permissions

Effective permission bitmask for (user, zone) within subsystem.

Source
effective_permissions(authority_id : String, subsystem : String, user_id : String, zone_ids : Array(String)) : Permissions

Effective permissions across a batch of zones. For every zone, the closest applicable grant in that zone's own ancestry wins (replace semantics — same rule as the single-zone form). Results are OR'd across the list: this answers "what can the user do if any of these zones is in play?". Zones with no applicable grant contribute nothing. Returns Permissions::None for an empty list or for a user who can't reach any of the supplied zones.

Source
from_rs(__temp_2364 : DB::ResultSet)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

on_error(err : Exception | IO::Error)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

primary_key

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

Source
resolve_subsystem_permissions(authority_id : String, subsystem : String, user_id : String) : Hash(String, Permissions)

Full {zone_id => Permissions} map for the user within subsystem. Public entry point for callers that want to resolve once and cache the whole map (e.g. a per-request memo), instead of re-resolving per query.

Source
table_name

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

zone_accessible?(authority_id : String, subsystem : String, user_id : String, zone_id : String) : Bool

Does this user have any non-zero effective permission on this zone (directly or transitively) for subsystem?

Source

Instance methods

acting_user
acting_user=(acting_user : PlaceOS::Model::User | Nil)
after_create

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

after_destroy

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

after_initialize(trusted : Bool)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

after_save

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

after_update

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

apply_defaults

Generate code to apply default values

assign_attributes(created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing, id : UUID | Missing = Missing, name : String | Missing = Missing, description : String | Missing = Missing, subsystems : Array(String) | Missing = Missing, authority_id : String | Missing = Missing, parent_id : UUID | 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::Group)

Assign to multiple attributes from a model object

assign_attributes_from_json(json, root : String)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

assign_attributes_from_json(json)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

assign_attributes_from_trusted_json(json, root : String)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

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)

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

assign_attributes_from_yaml(yaml)

Uses the YAML parser as JSON is valid YAML

attributes

Returns a Hash of all attribute values

attributes_tuple

Returns a NamedTuple of all attribute values.

authority
Source
authority!
Source
authority?
Source
authority_id

authority_id getter

authority_id=(value : String)

authority_id setter

authority_id?

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

authority_id_assigned?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

authority_id_change

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

authority_id_changed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

authority_id_default

authority_id's default value

Source
authority_id_present?
authority_id_removed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

authority_id_was

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

authority_id_will_change!

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

before_create

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

before_destroy

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

before_save

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

before_update

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

build_authority
Source
build_parent
Source
captured_changed_fields
captured_changed_fields=(captured_changed_fields : Array(String))
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

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

changed_yaml(io : IO) : Nil

Serialize the set of changed attributes to YAML.

changed_yaml

Serialize the set of changed attributes to YAML.

children

Immediate children.

Source
clear_changes_information

Reset changes for all attributes.

create_authority
Source
create_authority!
Source
create_parent
Source
create_parent!
Source
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?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

created_at_change

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

created_at_changed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

created_at_default

created_at's default value

created_at_present?
created_at_removed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

created_at_was

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

created_at_will_change!

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

descendant_ids

All descendant group ids (including self) via a recursive CTE.

Source
description

description getter

description=(value : String)

description setter

description?

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

description_assigned?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

description_change

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

description_changed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

description_default

description's default value

Source
description_present?
description_removed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

description_was

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

description_will_change!

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

group_users

Direct GroupUser rows for this group.

Source
group_zones

Direct GroupZone rows for this group.

Source
id

id getter

id=(value : UUID)

id setter

id?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

id_assigned?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

id_change

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

id_changed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

id_default

id's default value

id_present?
id_removed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

id_was

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

id_will_change!

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

invoke_props

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

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?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

name_change

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

name_changed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

name_default

name's default value

Source
name_present?
name_removed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

name_was

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

name_will_change!

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

parent
Source
parent!
Source
parent=(record : Group) : Group
Source
parent?
Source
parent_id

parent_id getter

parent_id=(value : UUID | Nil)

parent_id setter

parent_id_assigned?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

parent_id_change

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

parent_id_changed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

parent_id_default

parent_id's default value

Source
parent_id_present?
parent_id_removed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

parent_id_was

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

parent_id_will_change!

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

persistent_attributes

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

primary_key

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

Source
primary_key_hash

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

reload_authority
Source
reload_authority?
Source
reload_parent
Source
reload_parent?
Source
restore_attributes

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

subsystems

subsystems getter

subsystems=(value : Array(String))

subsystems setter

subsystems?

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.

subsystems_assigned?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

subsystems_change

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

subsystems_changed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

subsystems_default

subsystems's default value

Source
subsystems_present?
subsystems_removed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

subsystems_was

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

subsystems_will_change!

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

table_name

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

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?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

updated_at_change

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

updated_at_changed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

updated_at_default

updated_at's default value

updated_at_present?
updated_at_removed?

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

updated_at_was

A node in the group tree for an authority. The tree represents the organisational hierarchy. Each group declares which subsystems (signage, events, parking, ...) it participates in via the subsystems text array; subsystem-scoped permission queries are filtered against that array. A single root per authority is enforced by a partial unique index on (authority_id) WHERE parent_id IS NULL.

updated_at_will_change!

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

validate_nilability

Validate that all non-nillable fields have values.

was_new_record=(was_new_record : Bool)
was_new_record?

Nested types