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

abuse_reports_finder.rb « finders « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 04043f36426c25901b7a9749c4c4288f7289af4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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