Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-11 21:06:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-11 21:06:27 +0300
commitff67e3ed08355fb2d6f6e69d4ed06cd09052e573 (patch)
tree97ac29ddd32b612343b34bbdd6b8d57526b3d308 /app/finders/abuse_reports_finder.rb
parent7071f9bf3e131a7a668922ee450da529f1866b6f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders/abuse_reports_finder.rb')
-rw-r--r--app/finders/abuse_reports_finder.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/finders/abuse_reports_finder.rb b/app/finders/abuse_reports_finder.rb
new file mode 100644
index 00000000000..04043f36426
--- /dev/null
+++ b/app/finders/abuse_reports_finder.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AbuseReportsFinder
+ attr_reader :params
+
+ def initialize(params = {})
+ @params = params
+ end
+
+ def execute
+ reports = AbuseReport.all
+ reports = reports.by_user(params[:user_id]) if params[:user_id].present?
+
+ reports.with_order_id_desc
+ .with_users
+ .page(params[:page])
+ end
+end