Sha256: 0f1dd8fdd74b2373d9b684e8de2b7e858b898257aa07cf0d8fca5d6719d5660e

Contents?: true

Size: 1.14 KB

Versions: 9

Compression:

Stored size: 1.14 KB

Contents

json.cache! ['v1', @user.cache_key] do
  json.current_user do
    json.id @user.id
    json.name @user.name
    json.surname @user.surname
    json.email @user.email
    json.logged_in !!@user.id
    json.created_at @user.created_at ? @user.created_at.iso8601 : nil
    json.company @user.company
    json.phone @user.phone
    json.phone_country_code @user.phone_country_code
    json.country_code @user.geo_country_code || 'US'
    json.website @user.website
    json.sso_session @user.sso_session
    json.admin_role @user.admin_role

    # Embed association if user is persisted
    if @user.id
      json.organizations do
        json.array! (@user.organizations || []) do |o|
          json.id o.id
          json.uid o.uid
          json.name o.name
          json.currency o.billing_currency
          json.current_user_role o.role
          json.has_myob_essentials_only o.has_myob_essentials_only?
          json.financial_year_end_month o.financial_year_end_month
        end
      end

      if @user.deletion_request.present?
        json.deletion_request do
          json.extract! @user.deletion_request, :id, :token
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mno-enterprise-api-2.0.9 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder
mno-enterprise-api-2.0.8 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder
mno-enterprise-api-2.0.7 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder
mno-enterprise-api-2.0.6 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder
mno-enterprise-api-2.0.5 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder
mno-enterprise-api-2.0.4 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder
mno-enterprise-api-2.0.3 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder
mno-enterprise-api-2.0.2 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder
mno-enterprise-api-2.0.1 app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder