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