Styles, SQL format
This commit is contained in:
parent
d4331f4e65
commit
7042237218
1 changed files with 5 additions and 5 deletions
|
|
@ -105,17 +105,17 @@ class NodeInfoPresenter
|
||||||
end
|
end
|
||||||
|
|
||||||
def local_posts
|
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")
|
@local_posts ||= Post.where(type: "StatusMessage")
|
||||||
.joins(:author)
|
.joins(:author)
|
||||||
.where("owner_id IS NOT null")
|
.where.not(people: {owner_id: nil})
|
||||||
.count
|
.count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def local_comments
|
def local_comments
|
||||||
@local_comments ||= Comment.joins(:author)
|
@local_comments ||= Comment.joins(:author)
|
||||||
.where("owner_id IS NOT null")
|
.where.not(people: {owner_id: nil})
|
||||||
.count
|
.count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue