Class: Legion::Data::Model::Principal

Inherits:
Object
  • Object
show all
Includes:
Identity::ModelHelpers
Defined in:
lib/legion/data/models/principal.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Identity::ModelHelpers

#before_create, included, table_available?

Class Method Details

.lookup_columnsObject



21
22
23
# File 'lib/legion/data/models/principal.rb', line 21

def self.lookup_columns
  %i[id uuid canonical_name employee_key employee_id]
end

Instance Method Details

#active_groupsObject



25
26
27
28
29
30
31
# File 'lib/legion/data/models/principal.rb', line 25

def active_groups
  group_memberships_dataset
    .where(status: 'active')
    .eager(:group)
    .all
    .map(&:group)
end