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

Order results by distance #83

Merged
merged 1 commit into from
Dec 4, 2023
Merged

Order results by distance #83

merged 1 commit into from
Dec 4, 2023

Conversation

slawosz
Copy link
Contributor

@slawosz slawosz commented Nov 27, 2023

No description provided.

Copy link

Review app deployed to https://cpd-tsh-review-83.test.teacherservices.cloud/

@slawosz slawosz force-pushed the 1521-order-by-distance branch from ca3edd8 to ee58d2a Compare November 28, 2023 17:19
Comment on lines +3 to +7
result = []
authorities.each do |authority|
result << where("areas && ARRAY[?]::varchar[]", [authority]).to_a
end
result.flatten.uniq
Copy link
Member

Choose a reason for hiding this comment

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

This makes sense but how is it ordering them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The list of authorities is ordered.

@slawosz slawosz force-pushed the 1521-order-by-distance branch from ee58d2a to a63b566 Compare December 1, 2023 14:52
@slawosz slawosz merged commit 9ec3f03 into main Dec 4, 2023
9 checks passed
@slawosz slawosz deleted the 1521-order-by-distance branch December 4, 2023 09:54
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.

3 participants