blob: 9ddfd8dade6093ed57d05920586f1eef6a23a811 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class Mention < ActiveRecord::Base
belongs_to :post
belongs_to :person
validates :post, presence: true
validates :person, presence: true
after_destroy :delete_notification
def delete_notification
Notification.where(target_type: self.class.name, target_id: id).destroy_all
end
end
|