Conversation
| ) | ||
| belongs_to(:publication, optional: true) | ||
| validates(:name, presence: true) | ||
| validates(:parent, presence: true, unless: :incertae_sedis?) |
There was a problem hiding this comment.
This removes the ability to have incertae sedis without a parent. There are almost no cases of that. Wouldn't at least a domain placement always be possible?
| "<i>incertae sedis</i>#{qualifier}".html_safe | ||
| end | ||
|
|
||
| def incertae_sedis_parent_rank |
There was a problem hiding this comment.
More like minimum_incertae_sedis_parent_rank?
ddc7646 to
62b0b5a
Compare
bf35ee5 to
a537e97
Compare
62b0b5a to
0340bcf
Compare
a537e97 to
308f14d
Compare
0340bcf to
ef9da4a
Compare
308f14d to
5630d05
Compare
5630d05 to
73966e2
Compare
ef9da4a to
86c44cb
Compare
|
|
||
| private | ||
|
|
||
| def save_batch_placement(name, attributes) |
There was a problem hiding this comment.
I need to see if we can re-use existing paths for this logic.
f15f0f4 to
86c44cb
Compare
50ee332 to
33154e7
Compare
vangberg
left a comment
There was a problem hiding this comment.
@lmrodriguezr Ready for review
We have 7 names with incertae sedis without clarifying if they are bacteria or archaea. I think we will just have to manually go through them.
irb(main):023> Placement.where(incertae_sedis: "Incertae sedis").map(&:name)| incertae_sedis_text: par['description'] | ||
| } | ||
| name = Name.find_by_variants(par['name']) | ||
| placement = name.placements.find_or_initialize_by(parent: parent) |
There was a problem hiding this comment.
Duplication. I wanna tackle this in another PR as previously discussed.
| message: 'can only contain letters, dashes, dots, and apostrophe' | ||
| } | ||
| ) | ||
| validates(:incertae_sedis, inclusion: { in: [true, false] }, allow_nil: true) |
There was a problem hiding this comment.
This is gone when rebased against main.
| # GET /names/autocomplete.json?q=Allo&rank=genus | ||
| # GET /names/autocomplete.json?q=Pseu&minimum_rank=class | ||
| # GET /names/autocomplete.json?q=Allo&ranks=genus | ||
| # GET /names/autocomplete.json?q=Pseu&ranks=domain,phylum,class |
There was a problem hiding this comment.
I've combined these two params into a single param. So you just specify a list of ranks that are allowed. For known placements that list is just ["genus"] if name is a species etc.
| }, | ||
| failure: ->(_w, n) { | ||
| n.class.ranks.index(n.rank) != n.class.ranks.index(n.parent.rank) + 1 | ||
| !n.placement.allowed_parent_ranks.include?(n.placement.parent.rank) |
There was a problem hiding this comment.
In a previous version of this pull req I added a new quality check for the incertae sedis rank. WIth the new Placement#allowed_parent_ranks method they can easily be combined in a single quality check. @lmrodriguezr Please double check that this is OK :)
irb(main):002> Placement.where(incertae_sedis: "Incertae sedis").map(&:name).pluck(:name)
=> ["Adamsella", "Nitrosotaleales", "Endohaliclona", "Syntrophaliphaticia", "Acidifodinimicrobiaceae", "Hakubellales", "Chazhemtonibacteriaceae"] |
|
@lmrodriguezr Ready to review/merge |
Needs #333 to be merged first.
Screenshots
Video walk-through
CleanShot-2026-09-03-13-22-23.mp4