ticket https://brandslisten.atlassian.net/browse/BLCR-3399
params:
# participants_total
# returns count of all confirmed or auto-confirmed participants
has_many :participants, -> { distinct.joins(:participation_requests).where(bl_participation_requests: { status: %w[confirmed auto_confirmed] }) }, through: :participation_requests, source: :user
# participation_requests_total
# count of all confirmed, auto-confirmed, pending & decined participation requests
load_participation_requests.size
def load_participation_requests
@load_participation_requests ||= object.participation_requests.where(
status: [
:confirmed,
:auto_confirmed,
:pending,
:declined
]
).preload(
:user,
:attachments,
user: :profile_pictures
)
end
on current wl-sg
api returns:
"participation_requests_total": 8,
"participants_total": 6,
in backend:
6 confirmed members
2 pending members
frontend shows 6 + 2
on current eon-sg
api returns:
"participation_requests_total": ???, # not checked yet but probably 7
"participants_total": ???, # not checked yet but probably 5
in backend:
5 confirmed members
2 pending members
frontend shows 5 + 2
so my question is:
is it possible that participation_requests_total
gets set somewhere in the frontend instead of participants_total
?
this would explain the inclusion of pending members in the testers-count
Hey!
Why is for participation_requests the status relevant?
Should query all independent of status, only dependent of this one PT, not?