aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/mailers/track_mailer.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb
index bc3c162a3..7157e12d8 100644
--- a/app/mailers/track_mailer.rb
+++ b/app/mailers/track_mailer.rb
@@ -39,6 +39,7 @@ class TrackMailer < ApplicationMailer
def self.alert_tracks
done_something = false
now = Time.now()
+ one_week_ago = now - 7.days
User.find_each(:conditions => [ "last_daily_track_email < ?",
now - 1.day ]) do |user|
next if !user.should_be_emailed? || !user.receive_email_alerts
@@ -73,7 +74,7 @@ class TrackMailer < ApplicationMailer
end
next if track_thing.created_at >= result[:model].described_at # made before the track was created
- next if result[:model].described_at < now - 7.days # older than 1 week (see 14 days / 7 days in comment above)
+ next if result[:model].described_at < one_week_ago # older than 1 week (see 14 days / 7 days in comment above)
next if done_info_request_events.include?(result[:model].id) # definitely already done
# OK alert this one