Skip to content
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

Adding counties to partner export for NDBN reporting #4840

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

cielf
Copy link
Collaborator

@cielf cielf commented Dec 10, 2024

Partial #3067

Description

This adds a list of counties served, in case-insensitive order by county name within region, to the partner export

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

@cielf cielf requested a review from dorner December 10, 2024 03:37
# provides a county list in case insensitive alpha order, by region, then county name
counties = served_areas.map(&:county).uniq
counties.sort_by! { |county| [county.region.downcase, county.name.downcase] } # Our current world only has the US states, so downcasing the region doesn't really matter.
counties.pluck(:name).join("; ")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to SQL? You can add has_many :through for counties to the profile, and then you can do something like

self.counties.order(%w(region name)).pluck(:name).join('; ')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that will get me the downcase, but I'm sure there's a way to get that in there too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made those changes. Added a second profile to the test to make sure that there isn't crosstalk.

@cielf cielf requested a review from dorner December 11, 2024 01:18
@dorner dorner merged commit b5586da into rubyforgood:main Dec 13, 2024
11 checks passed
Copy link
Contributor

@cielf: Your PR Adding counties to partner export for NDBN reporting is part of today's Human Essentials production release: 2024.12.15.
Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants