Class: AbuseReport

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/abuse_report.rb

Overview

Schema Information

Table name: abuse_reports

id          :integer          not null, primary key
reporter_id :integer
user_id     :integer
message     :text
created_at  :datetime
updated_at  :datetime

Instance Method Summary collapse

Instance Method Details

#notifyObject


27
28
29
30
31
# File 'app/models/abuse_report.rb', line 27

def notify
  return unless self.persisted?

  AbuseReportMailer.notify(self.id).deliver_later
end

#remove_user(deleted_by:) ⇒ Object


22
23
24
25
# File 'app/models/abuse_report.rb', line 22

def remove_user(deleted_by:)
  user.block
  DeleteUserWorker.perform_async(deleted_by.id, user.id, delete_solo_owned_groups: true)
end