diaspora/app/models/mention.rb
2016-06-26 06:20:59 +02:00

16 lines
460 B
Ruby

# 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