Sha256: a401e8d884cf0f93c11975368c13c85904e5d85832ad8d840ca4e91276b698a7

Contents?: true

Size: 1010 Bytes

Versions: 66

Compression:

Stored size: 1010 Bytes

Contents

# frozen_string_literal: true

json.array!(@users) do |user|
  json.id user.id
  json.email user.email

  address_fields = [
    :name,
    :address1,
    :address2,
    :city,
    :zipcode,
    :phone,
    :state_name,
    :state_id,
    :country_id,
    :company
  ]
  json.ship_address do
    if user.ship_address
      json.(user.ship_address, *address_fields)
      if user.ship_address.state
        json.state do
          json.name user.ship_address.state.name
        end
      end
      if user.ship_address.country
        json.country do
          json.name user.ship_address.country.name
        end
      end
    end
  end

  json.bill_address do
    if user.bill_address
      json.(user.bill_address, *address_fields)
      if user.bill_address.state
        json.state do
          json.name user.bill_address.state.name
        end
      end
      if user.bill_address.country
        json.country do
          json.name user.bill_address.country.name
        end
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
solidus_backend-4.4.1 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.4.0 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.3.4 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.2.4 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.1.5 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.3.3 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.3.2 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.1.4 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.3.1 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.3.0 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.2.3 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.1.3 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.0.4 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-3.4.6 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.0.3 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.1.2 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.2.2 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-3.4.5 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.2.1 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-4.2.0 app/views/spree/admin/search/users.json.jbuilder