app/controllers/admin/store/easy_post_controller.rb
def batch
    shp = Shipment.new(shipment_params)

    job_params = {
        shipment_ids: params[:shipment_ids],
        carrier: shp.carrier,
        service: shp.ship_method,
        packaging: shp.packaging_type,
        length: shp.package_length.to_f,
        width: shp.package_width.to_f,
        height: shp.package_height.to_f,
        weight: shp.package_weight.to_f,
        require_signature: shp.require_signature,
        printer_id: params[:printer_id],
        send_email: params[:send_email] == "1",
        ship_date: shp.ship_date.to_s,
        user_id: session[:user_id]
    }

    Shipment.where(id: params[:shipment_ids]).update_all(batch_status: "queued", batch_status_message: "")
    BatchShipJob.perform_later(job_params)

    redirect_to action: :batch_status, shipment_ids: params[:shipment_ids].join(".")
  end
# Creates an EasyPost shipment object which contains rates
Creates an EasyPost shipment object which contains rates
Creates an EasyPost shipment object which contains rates
def batch
    shp = Shipment.new(shipment_params)
    job_params = {
        shipment_ids: params[:shipment_ids],
        carrier: shp.carrier,
        service: shp.ship_method,
        packaging: shp.packaging_type,
        length: shp.package_length.to_f,
        width: shp.package_width.to_f,
        height: shp.package_height.to_f,
        weight: shp.package_weight.to_f,
        require_signature: shp.require_signature,
        printer_id: params[:printer_id],
        send_email: params[:send_email] == "1",
        ship_date: shp.ship_date.to_s,
        user_id: session[:user_id]
    }
    Shipment.where(id: params[:shipment_ids]).update_all(batch_status: "queued", batch_status_message: "")
    BatchShipJob.perform_later(job_params)
    redirect_to action: :batch_status, shipment_ids: params[:shipment_ids].join(".")
  end
def batch shp = Shipment . new ( shipment_params ) job_params = { shipment_ids : params [ :shipment_ids ] , carrier : shp . carrier , service : shp . ship_method , packaging : shp . packaging_type , length : shp . package_length . to_f , width : shp . package_width . to_f , height : shp . package_height . to_f , weight : shp . package_weight . to_f , require_signature : shp . require_signature , printer_id : params [ :printer_id ] , send_email : params [ :send_email ] == "1" , ship_date : shp . ship_date . to_s , user_id : session [ :user_id ] } Shipment . where ( id : params [ :shipment_ids ] ) . update_all ( batch_status : "queued" , batch_status_message : "" ) BatchShipJob . perform_later ( job_params ) redirect_to action : :batch_status , shipment_ids : params [ :shipment_ids ] . join ( "." ) end
Creates an EasyPost shipment object which contains rates
Creates an EasyPost shipment object which contains rates