1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-30 11:24:21 +01:00
fab-manager/app/models/abuse.rb

18 lines
468 B
Ruby
Raw Normal View History

2016-03-23 18:39:41 +01:00
class Abuse < ActiveRecord::Base
include NotifyWith::NotificationAttachedObject
belongs_to :signaled, polymorphic: true
after_create :notify_admins_abuse_reported
2016-04-06 14:58:53 +02:00
validates :first_name, :last_name, :email, :message, :presence => true
2016-03-23 18:39:41 +01:00
private
def notify_admins_abuse_reported
NotificationCenter.call type: 'notify_admin_abuse_reported',
receiver: User.admins,
attached_object: self
end
end