aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/track_things_sent_email.rb
blob: 072d3bdea7f4d16391440d98f8e9e9b38a8fc4bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# == Schema Information
#
# Table name: track_things_sent_emails
#
#  id                    :integer          not null, primary key
#  track_thing_id        :integer          not null
#  info_request_event_id :integer
#  user_id               :integer
#  public_body_id        :integer
#  created_at            :datetime
#  updated_at            :datetime
#

# models/track_things_sent_email.rb:
# Record that alert has arrived.
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: hello@mysociety.org; WWW: http://www.mysociety.org/

class TrackThingsSentEmail < ActiveRecord::Base
    belongs_to :info_request_event
    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