Files
danbooru/app/logical/moderator/dashboard/queries/post_appeal.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

20 lines
449 B
Ruby

# frozen_string_literal: true
module Moderator
module Dashboard
module Queries
class PostAppeal
def self.all(min_date)
::Post
.joins(:appeals).includes(:uploader, :flags, appeals: [:creator])
.deleted
.where("post_appeals.created_at > ?", min_date)
.group(:id)
.order(Arel.sql("count(*) desc"))
.limit(10)
end
end
end
end
end