Skip to content

Commit

Permalink
add role to om
Browse files Browse the repository at this point in the history
  • Loading branch information
ameesha committed Jun 24, 2024
1 parent 945f711 commit 67d5979
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/workos/organization_membership.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def initialize(json)
@user_id = hash[:user_id]
@organization_id = hash[:organization_id]
@status = hash[:status]
@role = hash[:role]
@created_at = hash[:created_at]
@updated_at = hash[:updated_at]
@role = T.let(raw.role, RoleStruct)
end

def to_json(*)
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/workos/directory_user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
context 'with a role' do
it 'returns the role slug' do
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"[email protected]","emails":[{"primary":true,"value":"[email protected]"}, {"primary":false,"value":"[email protected]"}],"first_name":"Logan","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"role":{"slug":"member"},"created_at":"2022-05-13T17:45:31.732Z", "updated_at":"2022-07-13T17:45:42.618Z"}')
expect(user.role.slug).to eq('member')
expect(user.role).to eq({slug:'member'})
end
end
end
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 67d5979

Please sign in to comment.