Do not include user in their own follower count.
This commit is contained in:
parent
8d4e7b32c9
commit
e9037ffc8d
|
@ -265,6 +265,7 @@ def update_note_count(%User{} = user) do
|
||||||
def update_follower_count(%User{} = user) do
|
def update_follower_count(%User{} = user) do
|
||||||
follower_count_query = from u in User,
|
follower_count_query = from u in User,
|
||||||
where: fragment("? @> ?", u.following, ^user.follower_address),
|
where: fragment("? @> ?", u.following, ^user.follower_address),
|
||||||
|
where: u.id != ^user.id,
|
||||||
select: count(u.id)
|
select: count(u.id)
|
||||||
|
|
||||||
follower_count = Repo.one(follower_count_query)
|
follower_count = Repo.one(follower_count_query)
|
||||||
|
|
Loading…
Reference in a new issue