2018-09-14 05:42:05 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-08-06 13:08:22 +00:00
|
|
|
class Admin::AbuseReportsController < Admin::ApplicationController
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2015-08-06 13:08:22 +00:00
|
|
|
def index
|
|
|
|
@abuse_reports = AbuseReport.order(id: :desc).page(params[:page])
|
2017-03-31 04:47:22 +00:00
|
|
|
@abuse_reports.includes(:reporter, :user)
|
2015-08-06 13:08:22 +00:00
|
|
|
end
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2015-08-06 13:08:22 +00:00
|
|
|
|
|
|
|
def destroy
|
2015-08-25 08:52:10 +00:00
|
|
|
abuse_report = AbuseReport.find(params[:id])
|
2015-08-06 13:08:22 +00:00
|
|
|
|
2016-03-12 12:11:30 +00:00
|
|
|
abuse_report.remove_user(deleted_by: current_user) if params[:remove_user]
|
2015-08-25 08:52:10 +00:00
|
|
|
abuse_report.destroy
|
2016-01-13 01:48:16 +00:00
|
|
|
|
2016-03-16 01:16:25 +00:00
|
|
|
head :ok
|
2015-08-06 13:08:22 +00:00
|
|
|
end
|
|
|
|
end
|