-
-
Notifications
You must be signed in to change notification settings - Fork 571
filters archived children from children_served_count #5265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filters archived children from children_served_count #5265
Conversation
|
I'd add the |
|
It being in draft suffices to tell us not to review yet. |
|
Double checked that the children_served_count is only called in impact_metrics. |
|
Over to @dorner for technical review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint is failing - suggestion given above.
app/models/partner.rb
Outdated
|
|
||
| def children_served_count | ||
| children.count | ||
| children.reject { |child| child.archived? }.count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| children.reject { |child| child.archived? }.count | |
| children.count(&:archived?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I use this change it is the opposite of what we want. Let me check
children.count { |child| !child.archived? }
49ef211 to
2a63571
Compare
|
Should pass linter now. |
|
@john-huang-121: Your PR |
Resolves #5246
Description
Previously 'Children served' is just a total count of Children. This change addresses that children whom are archived no longer counts towards 'Children served'
Type of change
How Has This Been Tested?
Sign in as org_admin1@example.com
Click Partner Agencies, then "All Partners"
Click on "Pawnee Parent Service"
Note the number of children served is shown in the second section.
Sign out.
Sign in as verified@example.com
Click on Children in the left hand menu
Choose a child and "Edit Child Details"
Check the archived checkbox and update child.
Log back into the admin and check that the number went down by 1.
Screenshots
Before:

After:

