aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/track_things_sent_email.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/track_things_sent_email.rb')
-rw-r--r--app/models/track_things_sent_email.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/track_things_sent_email.rb b/app/models/track_things_sent_email.rb
index 35229371c..b39dad932 100644
--- a/app/models/track_things_sent_email.rb
+++ b/app/models/track_things_sent_email.rb
@@ -25,6 +25,12 @@ class TrackThingsSentEmail < ActiveRecord::Base
belongs_to :user
belongs_to :public_body
belongs_to :track_thing
+
+ # Called from cron job delete-old-things
+ def self.delete_old_track_things_sent_email
+ TrackThingsSentEmail.delete_all "updated_at < (now() - interval '1 month')"
+ end
+
end