We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[11] pry(main)> Species.distinct.pluck(:id) - Occurrence.distinct.pluck(:species_id).uniq (154.6ms) SELECT DISTINCT `species`.`id` FROM `species` (4.5ms) SELECT DISTINCT `occurrences`.`species_id` FROM `occurrences` => [59884] [12] pry(main)> Species.find(59884) Species Load (0.4ms) SELECT `species`.* FROM `species` WHERE `species`.`id` = 59884 LIMIT 1 => #<Species:0x00000000338d5620 id: 59884, path: "Aves/Cuculiformes/Cuculidae/Cuculus-micropterus", total_seqs: 14, total_bytes: 10028, aligned: true, taxon_kingdom: "Animalia", taxon_phylum: "Chordata", taxon_class: "Aves", taxon_order: "Cuculiformes", taxon_family: "Cuculidae", taxon_genus: "Cuculus", taxon_species: "Cuculus micropterus", taxon_subspecies: ""> [13] pry(main)> Species.find(59884).occurrences Species Load (0.3ms) SELECT `species`.* FROM `species` WHERE `species`.`id` = 59884 LIMIT 1 Occurrence Load (0.4ms) SELECT `occurrences`.* FROM `occurrences` WHERE `occurrences`.`species_id` = 59884 => [] [14] pry(main)>
The text was updated successfully, but these errors were encountered:
Another note says:
This may be indicative of a bug. What were the original occurrences, where did they go, why did this get created anyways?
Until then this can just be manually deleted in production by doing:
# give me a list of species id's to delete Species.where(id: (Species.distinct.pluck(:id) - Occurrence.distinct.pluck(:species_id).uniq)).delete_all
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: