Remove legacy incertae sedis - #333
Conversation
6ab1e49 to
45079be
Compare
d85f599 to
09057f0
Compare
45079be to
7865546
Compare
4a49fd4 to
09057f0
Compare
7865546 to
bf35ee5
Compare
2304b7b to
f967e96
Compare
bf35ee5 to
a537e97
Compare
f967e96 to
7281549
Compare
a537e97 to
308f14d
Compare
7281549 to
145ea82
Compare
308f14d to
5630d05
Compare
5630d05 to
73966e2
Compare
| name = Name.find_by_variants(par['name']) | ||
| name.update!(new_par) | ||
| name.update_column(:incertae_sedis, nil) if par['incertae_sedis'] | ||
| if placement_par |
There was a problem hiding this comment.
I need to review if we can do this a bit simpler/re-use existing code.
There was a problem hiding this comment.
This is not great, but I think it is easier to handle it after we are done with the incertae sedis-related changes. Then we can either go with the Name#preferred_placement proposal or implement some shared Name#set_preferred_placement method.
vangberg
left a comment
There was a problem hiding this comment.
@lmrodriguezr Ready for review.
There are 16 name records in production with non-nil incertae_sedis. They all have at least one placement record, which means that the incertae_sedis from Name is never read, so I think it is safe to remove this column.
irb(main):008> nx = Name.where.not(incertae_sedis: [nil, ""])
=>
[#<Name:0x0000735e803c7da8
...
irb(main):009> nx.size
=> 16
irb(main):010> nx.map {|n| n.placement.present?}
=> [true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true]| name = Name.find_by_variants(par['name']) | ||
| name.update!(new_par) | ||
| name.update_column(:incertae_sedis, nil) if par['incertae_sedis'] | ||
| if placement_par |
There was a problem hiding this comment.
This is not great, but I think it is easier to handle it after we are done with the incertae sedis-related changes. Then we can either go with the Name#preferred_placement proposal or implement some shared Name#set_preferred_placement method.
Draft – #332 needs to be merged first.
We still have the legacy
Name#incertae_sedisfield in the database. In preparation for #173 I would like to remove it to reduce the number of edge cases we need to handle.I have investigated the current state of
Name#incertae_sedisin the production database:There are 16 names with legacy
incertae_sedisset:All 16 records have a placement with either a
parentorincertae_sedis, which can be verified by running the following:I interpret that as it being safe to drop this column from the database.