From 51c80db7a35a41fbbab9b28e86a5d60166791b4c Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 27 Nov 2013 12:03:28 +0000 Subject: Split the creation of a batch and the associated requests. We're going to want to actually create and send the requests later. --- app/controllers/request_controller.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index bef3575cc..2bf1a2c0c 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -244,11 +244,12 @@ class RequestController < ApplicationController return render_new_preview end - batch_results = InfoRequestBatch.create_batch!(params[:info_request], - params[:outgoing_message], - params[:public_body_ids], - authenticated_user) - @info_request_batch = batch_results[:batch] + @info_request_batch = InfoRequestBatch.create!(:title => params[:info_request][:title], + :body => params[:outgoing_message][:body], + :public_bodies => @public_bodies, + :user => authenticated_user ) + + batch_results = @info_request_batch.create_batch! flash[:notice] = _("

Your {{law_used_full}} requests have been sent!

We will email you when there is a response to any of them, or after {{late_number_of_days}} working days if the authorities still haven't replied by then.

-- cgit v1.2.3