mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
22 lines
631 B
Ruby
22 lines
631 B
Ruby
# frozen_string_literal: true
|
|
|
|
json.extract! user, :id, :email, :created_at
|
|
json.extract! user.profile, :full_name, :first_name, :last_name if user.association(:profile).loaded?
|
|
json.gender user.statistic_profile.gender ? 'man' : 'woman'
|
|
|
|
if user.association(:invoicing_profile).loaded?
|
|
json.external_id user.invoicing_profile.external_id
|
|
json.organization !user.invoicing_profile.organization.nil?
|
|
json.address user.invoicing_profile.invoicing_address
|
|
end
|
|
|
|
if user.association(:group).loaded?
|
|
json.group do
|
|
if user.group_id?
|
|
json.extract! user.group, :id, :name, :slug
|
|
else
|
|
json.nil!
|
|
end
|
|
end
|
|
end
|