spec/apps/dummy/app/models/mock_user.rb in scimitar-2.8.0 vs spec/apps/dummy/app/models/mock_user.rb in scimitar-2.9.0

- old
+ new

@@ -16,10 +16,11 @@ work_email_address home_email_address work_phone_number organization department + manager mock_groups } has_and_belongs_to_many :mock_groups @@ -46,10 +47,11 @@ return { id: :primary_key, externalId: :scim_uid, userName: :username, password: :password, + active: :is_active, name: { givenName: :first_name, familyName: :last_name }, emails: [ @@ -78,27 +80,32 @@ value: :work_phone_number, primary: false } }, ], - groups: [ # NB read-only, so no :find_with key + groups: [ { + # Read-only, so no :find_with key. There's no 'class' specified here + # either, to help test the "/Schemas" endpoint's reflection code. + # list: :mock_groups, using: { value: :id, display: :display_name } } ], - active: :is_active, # Custom extension schema - see configuration in # "spec/apps/dummy/config/initializers/scimitar.rb". # organization: :organization, department: :department, primaryEmail: :scim_primary_email, + + manager: :manager, + userGroups: [ { list: :mock_groups, find_with: ->(value) { MockGroup.find(value["value"]) }, using: { @@ -128,10 +135,11 @@ 'emails.type' => { ignore: true }, # We can't filter on that; it'll just search all e-mails 'primaryEmail' => { column: :scim_primary_email }, } end - # reader + # Custom attribute reader + # def scim_primary_email work_email_address end include Scimitar::Resources::Mixin