Sha256: 71a40662f2d34cd9131abbba3198bc8c37e1052c1f4f9ab172cabec979843051

Contents?: true

Size: 982 Bytes

Versions: 47

Compression:

Stored size: 982 Bytes

Contents

# frozen_string_literal: true

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

  address_fields = [:firstname, :lastname, :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

47 entries across 47 versions & 2 rubygems

Version Path
solidus_backend-2.10.5 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.10.3 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.10.2 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.9.6 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.8.6 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.10.1 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.9.5 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.10.0 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.9.4 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.6.6 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.7.4 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.8.5 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.9.3 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.9.2 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.10.0.beta1 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.7.3 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.6.5 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.9.1 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.9.0 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.9.0.rc.1 app/views/spree/admin/search/users.json.jbuilder