2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
class Admin::AbuseReportsController < Admin::ApplicationController
|
2018-12-05 23:21:45 +05:30
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2015-09-11 14:41:01 +05:30
|
|
|
def index
|
|
|
|
@abuse_reports = AbuseReport.order(id: :desc).page(params[:page])
|
2017-08-17 22:00:37 +05:30
|
|
|
@abuse_reports.includes(:reporter, :user)
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|
2018-12-05 23:21:45 +05:30
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2015-09-11 14:41:01 +05:30
|
|
|
|
|
|
|
def destroy
|
|
|
|
abuse_report = AbuseReport.find(params[:id])
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
abuse_report.remove_user(deleted_by: current_user) if params[:remove_user]
|
2015-09-11 14:41:01 +05:30
|
|
|
abuse_report.destroy
|
2016-01-14 18:37:52 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
head :ok
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|
|
|
|
end
|