Sha256: 45e517da6da67850cb406adc6608207b1ff0927a6a330759e6d9efe8dd7d04ed

Contents?: true

Size: 924 Bytes

Versions: 13

Compression:

Stored size: 924 Bytes

Contents

class Api::ShipmentsController < Api::BaseController
  resource_controller_for_api
  actions :index, :show, :update, :create
  belongs_to :order

  private

    def collection_serialization_options
      { :include => {:shipping_method => {}, :address => {}, :inventory_units => {:include => :variant}},
      :except => [:shipping_method_id, :address_id] }
    end

    def object_serialization_options
      { :include =>  {
        :shipping_method => {},
        :address => {:include => [:country, :state]},
        :inventory_units => {
          :include => {
            :variant => {
              :include => {
                :product => {:only => [:name]}
                }
              }
            }
          }
        },
        :except => [:shipping_method_id, :address_id]
      }
    end

    def eager_load_associations
      [:shipping_method, :address, {:inventory_units => [:variant]}]
    end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spree_api-0.30.2 app/controllers/api/shipments_controller.rb
spree_api-0.40.4 app/controllers/api/shipments_controller.rb
spree_api-0.50.4 app/controllers/api/shipments_controller.rb
spree_api-0.50.3 app/controllers/api/shipments_controller.rb
spree_api-0.50.2 app/controllers/api/shipments_controller.rb
spree_api-0.50.1 app/controllers/api/shipments_controller.rb
spree_api-0.50.0 app/controllers/api/shipments_controller.rb
spree_api-0.40.3 app/controllers/api/shipments_controller.rb
spree_api-0.40.2 app/controllers/api/shipments_controller.rb
spree_api-0.40.1 app/controllers/api/shipments_controller.rb
spree_api-0.40.0 app/controllers/api/shipments_controller.rb
spree_api-0.30.1 app/controllers/api/shipments_controller.rb
spree_api-0.30.0 app/controllers/api/shipments_controller.rb