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_devise_token_auth-2.8.0.alpha.4 app/views/spree/admin/search/users.json.jbuilder
solidus_backend_devise_token_auth-2.8.0.alpha.3 app/views/spree/admin/search/users.json.jbuilder
solidus_backend_devise_token_auth-2.8.0.alpha.2 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.7.0 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.6.1 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.6.0 app/views/spree/admin/search/users.json.jbuilder
solidus_backend-2.6.0.rc1 app/views/spree/admin/search/users.json.jbuilder