Class: Admin::AbuseReportLabelsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/admin/abuse_report_labels_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(current_user, params = {}) ⇒ AbuseReportLabelsFinder

Returns a new instance of AbuseReportLabelsFinder.



5
6
7
8
# File 'app/finders/admin/abuse_report_labels_finder.rb', line 5

def initialize(current_user, params = {})
  @current_user = current_user
  @params = params
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
# File 'app/finders/admin/abuse_report_labels_finder.rb', line 10

def execute
  return Admin::AbuseReportLabel.none unless current_user&.can_admin_all_resources?

  items = Admin::AbuseReportLabel.all
  items = by_search(items)

  items.order(title: :asc) # rubocop: disable CodeReuse/ActiveRecord
end