Class: Admin::AbuseReportLabelsFinder
- Inherits:
-
Object
- Object
- Admin::AbuseReportLabelsFinder
- Defined in:
- app/finders/admin/abuse_report_labels_finder.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user, params = {}) ⇒ AbuseReportLabelsFinder
constructor
A new instance of AbuseReportLabelsFinder.
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
#execute ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/finders/admin/abuse_report_labels_finder.rb', line 10 def execute return AntiAbuse::Reports::Label.none unless current_user&.can_admin_all_resources? items = AntiAbuse::Reports::Label.all items = by_search(items) items.order(title: :asc) # rubocop: disable CodeReuse/ActiveRecord end |