diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-05-26 16:32:12 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-05-26 16:32:12 +0100 |
commit | df5e41ebe0a26dcce321845593930955bead952c (patch) | |
tree | 19c19e13831035a94d5055296580763e273c823b /app/models/info_request_batch.rb | |
parent | 6db8ee1e2d952700cf12f9cf54573012a211f74a (diff) | |
parent | b90a5f5df568dc68e971a7d43532b5163f6cd08e (diff) |
Merge remote-tracking branch 'jpmckinney_github/class_methods' into rails-3-develop
Diffstat (limited to 'app/models/info_request_batch.rb')
-rw-r--r-- | app/models/info_request_batch.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/info_request_batch.rb b/app/models/info_request_batch.rb index b831f3042..684467c61 100644 --- a/app/models/info_request_batch.rb +++ b/app/models/info_request_batch.rb @@ -22,7 +22,7 @@ class InfoRequestBatch < ActiveRecord::Base validates_presence_of :body # When constructing a new batch, use this to check user hasn't double submitted. - def InfoRequestBatch.find_existing(user, title, body, public_body_ids) + def self.find_existing(user, title, body, public_body_ids) find(:first, :conditions => ['user_id = ? AND title = ? AND body = ? @@ -70,7 +70,7 @@ class InfoRequestBatch < ActiveRecord::Base info_request end - def InfoRequestBatch.send_batches + def self.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, |