aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-01-02 20:13:01 +0000
committerfrancis <francis>2008-01-02 20:13:01 +0000
commit9a413547d752f024908dffcb851bcec7600f81de (patch)
treea3d88d832313592f8535ab03b3969faae786be85 /app/models/info_request.rb
parentbbdde67fdee9c02dce26aaf20ce93344a2899951 (diff)
Rename outgoing message field from sent_at to last_sent_at, as it records
the time the message was last sent, not every time it was sent.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 57a1a422f..8447dcbc4 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -17,7 +17,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request.rb,v 1.21 2008-01-02 18:16:39 francis Exp $
+# $Id: info_request.rb,v 1.22 2008-01-02 20:13:01 francis Exp $
require 'digest/sha1'
@@ -92,7 +92,9 @@ class InfoRequest < ActiveRecord::Base
overdue = false
# XXX if a second outgoing message is really a new request, then this
# is no good
- earliest_sent = self.outgoing_messages.map { |om| om.sent_at }.min
+ # We use the last_sent_at date for each outgoing message, as fair
+ # enough if the first email bounced or something and it got recent.
+ earliest_sent = self.outgoing_messages.map { |om| om.last_sent_at }.min
time_left = Time.now - earliest_sent
# XXX use working days
if time_left > 20.days