app/controllers/concerns/comable/shipment_action.rb in comable_frontend-0.2.3 vs app/controllers/concerns/comable/shipment_action.rb in comable_frontend-0.3.0

- old
+ new

@@ -1,22 +1,12 @@ module Comable module ShipmentAction - def shipment - case request.method_symbol - when :post - redirect_to next_order_path - end - end - private # orderride OrdersController#order_params def order_params - (action_name.to_sym == :shipment) ? order_params_for_shipment : super - end - - def shipment_required? - Comable::ShipmentMethod.activated.exists? + return super unless params[:state] == 'shipment' + order_params_for_shipment end def order_params_for_shipment params.fetch(:order, {}).permit( :shipment_method_id