aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-11-27 12:03:28 +0000
committerLouise Crow <louise.crow@gmail.com>2013-12-04 09:32:44 +0000
commit51c80db7a35a41fbbab9b28e86a5d60166791b4c (patch)
treebd2cdf0c16fa6907e4cc06c41c335c630386d375 /app/controllers/request_controller.rb
parentabc1b8069da09d3ef8523ed64c60b2790a41bf01 (diff)
Split the creation of a batch and the associated requests.
We're going to want to actually create and send the requests later.
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb11
1 files changed, 6 insertions, 5 deletions
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] = _("<p>Your {{law_used_full}} requests have been <strong>sent</strong>!</p>
<p><strong>We will email you</strong> 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.</p>