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.
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
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.
macro level key => type
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
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.
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">
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.
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.
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.
Class methods
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.
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).
Returns all attribute keys.
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 permission bitmask for (user, zone) within subsystem.
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.
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.
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.
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.
Instance methods
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.
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.
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.
Generate code to apply default values
Assign to multiple attributes.
Assign to multiple attributes via HTTP::Params.
Assign to multiple attributes from a model 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.
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.
Assign each field from JSON if field exists in JSON and has changed in model
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.
Uses the YAML parser as JSON is valid YAML
Returns a Hash of all attribute values
Returns a NamedTuple of all attribute values.
authority_id getter
authority_id setter
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.
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.
Returns a Tuple of the previous and the current value of an instance variable if it has 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.
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.
Include authority_id in the set of changed attributes, whether it has changed or not.
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.
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.
Check if any attributes have changed.
Returns a Hash with all changed attributes.
Serialize the set of changed attributes to JSON.
Serialize the set of changed attributes to 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.
Serialize the set of changed attributes to YAML.
Serialize the set of changed attributes to YAML.
Reset changes for all attributes.
created_at getter
Setters
created_at setter
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.
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.
Returns a Tuple of the previous and the current value of an instance variable if it has 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's default value
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.
Include created_at in the set of changed attributes, whether it has changed or not.
description getter
description setter
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.
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.
Returns a Tuple of the previous and the current value of an instance variable if it has 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.
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.
Include description in the set of changed attributes, whether it has changed or not.
id getter
id setter
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.
Returns a Tuple of the previous and the current value of an instance variable if it has 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's default value
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.
Include id in the set of changed attributes, whether it has changed or not.
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 getter
name setter
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.
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.
Returns a Tuple of the previous and the current value of an instance variable if it has 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.
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.
Include name in the set of changed attributes, whether it has changed or not.
parent_id getter
parent_id setter
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.
Returns a Tuple of the previous and the current value of an instance variable if it has 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.
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.
Include parent_id in the set of changed attributes, whether it has changed or not.
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.
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.
Reset each attribute to their previous values and clears all changes.
subsystems getter
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.
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.
Returns a Tuple of the previous and the current value of an instance variable if it has 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.
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.
Include subsystems in the set of changed attributes, whether it has changed or not.
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 getter
updated_at setter
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.
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.
Returns a Tuple of the previous and the current value of an instance variable if it has 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's default value
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.
Include updated_at in the set of changed attributes, whether it has changed or not.
Validate that all non-nillable fields have values.