Class: Spree::Api::ShipmentsController
Instance Attribute Summary
#current_api_user
Instance Method Summary
collapse
#map_nested_attributes_keys, #set_jsonp_format
included
Instance Method Details
#ready ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/controllers/spree/api/shipments_controller.rb', line 9
def ready
authorize! :read, Shipment
unless @shipment.ready?
if @shipment.can_ready?
@shipment.ready!
else
render "spree/api/shipments/cannot_ready_shipment", :status => 422 and return
end
end
respond_with(@shipment, :default_template => :show)
end
|
#ship ⇒ Object
21
22
23
24
25
26
27
|
# File 'app/controllers/spree/api/shipments_controller.rb', line 21
def ship
authorize! :read, Shipment
unless @shipment.shipped?
@shipment.ship!
end
respond_with(@shipment, :default_template => :show)
end
|