2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-31 07:02:26 -05:00
|
|
|
class Admin::ScreenedUrlsController < Admin::StaffController
|
2013-08-15 09:48:30 -05:00
|
|
|
def index
|
2013-11-04 15:31:31 -06:00
|
|
|
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",
|
2023-01-09 06:20:10 -06:00
|
|
|
)
|
2013-11-04 15:31:31 -06:00
|
|
|
.group(:domain)
|
|
|
|
.order("last_match_at DESC")
|
|
|
|
.to_a
|
2013-11-04 15:24:32 -06:00
|
|
|
render_serialized(screened_urls, GroupedScreenedUrlSerializer)
|
2013-08-15 09:48:30 -05:00
|
|
|
end
|
|
|
|
end
|