1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-19 08:52:25 +01:00
fab-manager/app/views/open_api/v1/users/_user.json.jbuilder

18 lines
508 B
Ruby

# frozen_string_literal: true
json.extract! user, :id, :email, :created_at, :external_id
json.full_name user.profile.full_name if user.association(:profile).loaded?
json.gender user.statistic_profile.gender ? 'man' : 'woman'
json.organization !user.invoicing_profile.organization.nil?
json.address user.invoicing_profile.invoicing_address
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