Class: Spree::Api::V2::Storefront::OrderProductsTaxonsController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/spree/api/v2/storefront/order_products_taxons_controller.rb

Instance Method Summary collapse

Instance Method Details

#collectionObject



6
7
8
# File 'app/controllers/spree/api/v2/storefront/order_products_taxons_controller.rb', line 6

def collection
  @collection || order.taxons
end

#collection_serializerObject



14
15
16
# File 'app/controllers/spree/api/v2/storefront/order_products_taxons_controller.rb', line 14

def collection_serializer
  Spree::V2::Storefront::TaxonSerializer
end

#orderObject



10
11
12
# File 'app/controllers/spree/api/v2/storefront/order_products_taxons_controller.rb', line 10

def order
  @order ||= Spree::Order.find_by!(number: order_params[:number])
end

#order_paramsObject



18
19
20
# File 'app/controllers/spree/api/v2/storefront/order_products_taxons_controller.rb', line 18

def order_params
  params.permit(:number)
end