spec/apps/dummy/app/models/mock_user.rb in scimitar-1.5.3 vs spec/apps/dummy/app/models/mock_user.rb in scimitar-1.6.0

- old
+ new

@@ -13,10 +13,11 @@ work_email_address home_email_address work_phone_number organization department + mock_groups } has_and_belongs_to_many :mock_groups # A fixed value read-only attribute, in essence. @@ -88,11 +89,21 @@ # Custom extension schema - see configuration in # "spec/apps/dummy/config/initializers/scimitar.rb". # organization: :organization, - department: :department + department: :department, + userGroups: [ + { + list: :mock_groups, + find_with: ->(value) { MockGroup.find(value["value"]) }, + using: { + value: :id, + display: :display_name + } + } + ] } end def self.scim_mutable_attributes return nil @@ -103,9 +114,11 @@ 'id' => { column: :primary_key }, 'externalId' => { column: :scim_uid }, 'meta.lastModified' => { column: :updated_at }, 'name.givenName' => { column: :first_name }, 'name.familyName' => { column: :last_name }, + 'groups' => { column: MockGroup.arel_table[:id] }, + 'groups.value' => { column: MockGroup.arel_table[:id] }, 'emails' => { columns: [ :work_email_address, :home_email_address ] }, 'emails.value' => { columns: [ :work_email_address, :home_email_address ] }, 'emails.type' => { ignore: true } # We can't filter on that; it'll just search all e-mails } end