1
0
Fork 0
forked from mirrors/akkoma

Do not include user in their own follower count.

This commit is contained in:
eal 2017-11-21 15:33:09 +02:00
parent 8d4e7b32c9
commit e9037ffc8d

View file

@ -265,6 +265,7 @@ def update_note_count(%User{} = user) do
def update_follower_count(%User{} = user) do
follower_count_query = from u in User,
where: fragment("? @> ?", u.following, ^user.follower_address),
where: u.id != ^user.id,
select: count(u.id)
follower_count = Repo.one(follower_count_query)