aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/info_request_batch.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/info_request_batch.rb b/app/models/info_request_batch.rb
index 7e7390736..498ab4951 100644
--- a/app/models/info_request_batch.rb
+++ b/app/models/info_request_batch.rb
@@ -61,4 +61,13 @@ class InfoRequestBatch < ActiveRecord::Base
info_request.save!
info_request
end
+
+ def InfoRequestBatch.send_batches()
+ find_each(:conditions => "sent_at IS NULL") do |info_request_batch|
+ unrequestable = info_request_batch.create_batch!
+ mail_message = InfoRequestBatchMailer.batch_sent(info_request_batch,
+ unrequestable,
+ info_request_batch.user).deliver
+ end
+ end
end