mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
(feat) map external id from sso
This commit is contained in:
parent
91dd7b174e
commit
f204f654c2
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- Add more context data to sentry reports
|
- Add more context data to sentry reports
|
||||||
- Improved SSO testing
|
- Improved SSO testing
|
||||||
|
- Ability to map the external ID from the SSO
|
||||||
- Fix a bug: unable to run task fix_invoice_item when some invoice items are associated with errors
|
- Fix a bug: unable to run task fix_invoice_item when some invoice items are associated with errors
|
||||||
- Fix a bug: invalid event date reported when the timezone in before UTC
|
- Fix a bug: invalid event date reported when the timezone in before UTC
|
||||||
- Fix a bug: unable to run accounting export if a line label was not defined
|
- Fix a bug: unable to run accounting export if a line label was not defined
|
||||||
|
@ -28,7 +28,7 @@ class Profile < ApplicationRecord
|
|||||||
blacklist = %w[id user_id created_at updated_at]
|
blacklist = %w[id user_id created_at updated_at]
|
||||||
# model-relationships must be added manually
|
# model-relationships must be added manually
|
||||||
additional = [%w[avatar string], %w[address string], %w[organization_name string], %w[organization_address string],
|
additional = [%w[avatar string], %w[address string], %w[organization_name string], %w[organization_address string],
|
||||||
%w[gender boolean], %w[birthday date]]
|
%w[gender boolean], %w[birthday date], %w[external_id string]]
|
||||||
Profile.columns_hash
|
Profile.columns_hash
|
||||||
.map { |k, v| [k, v.type.to_s] }
|
.map { |k, v| [k, v.type.to_s] }
|
||||||
.delete_if { |col| blacklist.include?(col[0]) }
|
.delete_if { |col| blacklist.include?(col[0]) }
|
||||||
|
@ -40,6 +40,11 @@ class UserSetterService
|
|||||||
@user.statistic_profile.birthday = data
|
@user.statistic_profile.birthday = data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def assign_external_id(data)
|
||||||
|
@user.invoicing_profile ||= InvoicingProfile.new
|
||||||
|
@user.invoicing_profile.external_id = data
|
||||||
|
end
|
||||||
|
|
||||||
def assign_profile_attribute(attribute, data)
|
def assign_profile_attribute(attribute, data)
|
||||||
@user.profile[attribute[8..].to_sym] = data
|
@user.profile[attribute[8..].to_sym] = data
|
||||||
end
|
end
|
||||||
@ -65,6 +70,8 @@ class UserSetterService
|
|||||||
assign_gender(data)
|
assign_gender(data)
|
||||||
when 'profile.birthday'
|
when 'profile.birthday'
|
||||||
assign_birthday(data)
|
assign_birthday(data)
|
||||||
|
when 'profile.external_id'
|
||||||
|
assign_external_id(data)
|
||||||
else
|
else
|
||||||
assign_profile_attribute(attribute, data)
|
assign_profile_attribute(attribute, data)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user