You can report a single post by clicking the correct icon in the controler section Workflow: * Report a post as offensive * Trigger alerts to every pod-admin * Pod-admin can review it in the admin interface * Delete the post or mark it as reviewed
15 lines
313 B
Ruby
15 lines
313 B
Ruby
class PostReport < ActiveRecord::Base
|
|
validates :user_id, presence: true
|
|
validates :post_id, presence: true
|
|
|
|
belongs_to :user
|
|
belongs_to :post
|
|
|
|
has_many :post_reports
|
|
|
|
after_create :send_report_notification
|
|
|
|
def send_report_notification
|
|
Workers::Mail::PostReportWorker.perform_async
|
|
end
|
|
end
|