5
3
mirror of https://github.com/tildeverse/lobsters synced 2024-06-14 21:16:37 +00:00

use memoized field

This commit is contained in:
Peter Bhat Harkins 2021-12-25 21:21:40 -06:00
parent c80aa2e1fa
commit 7e02d74503

View File

@ -27,6 +27,7 @@ class ModController < ApplicationController
@title = "Flagged Comments"
@comments = period(Comment
.eager_load(:user, :hat, :story => :user, :votes => :user)
.where("comments.flags >= 2")
.where("(select count(*) from votes where
votes.comment_id = comments.id and
vote < 0 and