diaspora/app/models/post_report.rb
Lukas Matt 5c9a3aaf3e Added post report feature
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
2014-01-14 15:00:55 -05:00

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