1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

[SSO] fix re-mapping of avatar, address and organization

This commit is contained in:
Sylvain 2016-09-12 12:10:46 +02:00
parent 0f8f1a14b4
commit 336158c5ad

View File

@ -234,7 +234,18 @@ class User < ActiveRecord::Base
if parsed[1] == 'user'
self[parsed[2].to_sym]
elsif parsed[1] == 'profile'
self.profile[parsed[2].to_sym]
case sso_mapping
when 'profile.avatar'
self.profile.user_avatar.remote_attachment_url
when 'profile.address'
self.profile.address.address
when 'profile.organization_name'
self.profile.organization.name
when 'profile.organization_address'
self.profile.organization.address.address
else
self.profile[parsed[2].to_sym]
end
end
end