Styles, SQL format

This commit is contained in:
Thorsten Claus 2021-05-09 10:23:07 +02:00 committed by Benjamin Neff
parent d4331f4e65
commit 7042237218
No known key found for this signature in database
GPG key ID: 971464C3F1A90194

View file

@ -105,17 +105,17 @@ class NodeInfoPresenter
end
def local_posts
Rails.cache.fetch("NodeInfoPresenter/local_posts", expires_in: 1.hours) do
Rails.cache.fetch("NodeInfoPresenter/local_posts", expires_in: 1.hour) do
@local_posts ||= Post.where(type: "StatusMessage")
.joins(:author)
.where("owner_id IS NOT null")
.count
.joins(:author)
.where.not(people: {owner_id: nil})
.count
end
end
def local_comments
@local_comments ||= Comment.joins(:author)
.where("owner_id IS NOT null")
.where.not(people: {owner_id: nil})
.count
end
end