Class: Spree::Api::InventoryUnitsController
- Inherits:
-
BaseController
- Object
- ActionController::Metal
- BaseController
- Spree::Api::InventoryUnitsController
show all
- Defined in:
- app/controllers/spree/api/inventory_units_controller.rb
Instance Attribute Summary
#current_api_user
Instance Method Summary
collapse
#map_nested_attributes_keys, #set_jsonp_format
included
Instance Method Details
#show ⇒ Object
6
7
8
|
# File 'app/controllers/spree/api/inventory_units_controller.rb', line 6
def show
@inventory_unit = inventory_unit
end
|
#update ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/spree/api/inventory_units_controller.rb', line 10
def update
authorize! :update, Order
inventory_unit.transaction do
if inventory_unit.update_attributes(params[:inventory_unit])
fire
render :show, :status => 200
else
invalid_resource!(inventory_unit)
end
end
end
|