Add minimum_rank to name autocomplete - #336
Merged
Merged
Conversation
vangberg
force-pushed
the
rank-aware-name-autocomplete
branch
from
September 3, 2026 11:57
9e7d984 to
894a1bb
Compare
vangberg
marked this pull request as draft
September 3, 2026 11:59
vangberg
force-pushed
the
direct-batch-placements
branch
from
September 3, 2026 12:12
2304b7b to
f967e96
Compare
vangberg
force-pushed
the
rank-aware-name-autocomplete
branch
from
September 3, 2026 12:12
894a1bb to
0bfb581
Compare
vangberg
force-pushed
the
direct-batch-placements
branch
from
September 3, 2026 12:28
f967e96 to
7281549
Compare
vangberg
force-pushed
the
rank-aware-name-autocomplete
branch
from
September 3, 2026 12:30
0bfb581 to
074cca4
Compare
vangberg
force-pushed
the
direct-batch-placements
branch
from
September 3, 2026 12:39
7281549 to
145ea82
Compare
vangberg
marked this pull request as ready for review
September 3, 2026 12:41
vangberg
force-pushed
the
rank-aware-name-autocomplete
branch
from
September 3, 2026 12:43
074cca4 to
59a7072
Compare
Contributor
Author
|
@lmrodriguezr This is ready for review as well. Beware that it needs to be rebased against main after merging #332. |
vangberg
commented
Sep 3, 2026
| .limit(20) | ||
| @names = @names.where(rank: rank) if rank | ||
| if minimum_rank && (rank_index = Name.ranks.index(minimum_rank)) | ||
| @names = @names.where(rank: Name.ranks.take(rank_index + 1)) |
Contributor
Author
There was a problem hiding this comment.
Maybe extract to a helper method?
Member
There was a problem hiding this comment.
Yes, this looks helpful for other parts of the code :)
lmrodriguezr
approved these changes
Sep 4, 2026
lmrodriguezr
left a comment
Member
There was a problem hiding this comment.
I really like this! It may not need rebasing but I'll leave the merge for you
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wait for #332 to be merged first, then rebase this against main.
For #173 it would be nice to be able to specify a minimum rank for the name autocomplete, so we don't show names that are not valid, e.g. families if the name with incertae sedis placement is a species.
In addition, I added formatting which shows the rank of the name.
I also added a dev-only
/dev/autocompleteendpoint which shows the different autocomplete variations. We can remove that if you want.