2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-05 15:27:34 +08:00
discourse/app/controllers/admin/screened_urls_controller.rb
2023-01-09 14:14:59 +00:00

15 lines
442 B
Ruby

# frozen_string_literal: true
class Admin::ScreenedUrlsController < Admin::StaffController
def index
screened_urls =
ScreenedUrl
.select(
"domain, sum(match_count) as match_count, max(last_match_at) as last_match_at, min(created_at) as created_at",
)
.group(:domain)
.order("last_match_at DESC")
.to_a
render_serialized(screened_urls, GroupedScreenedUrlSerializer)
end
end