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

Set fossil flag for non-fossil taxa with fossil protonyms script #846

Closed
jonkerz opened this issue Jan 17, 2020 · 1 comment
Closed

Set fossil flag for non-fossil taxa with fossil protonyms script #846

jonkerz opened this issue Jan 17, 2020 · 1 comment
Labels
Milestone

Comments

@jonkerz
Copy link
Member

jonkerz commented Jan 17, 2020

Db script: http://antcat.org/database_scripts/non_fossil_taxa_with_fossil_protonyms

@jonkerz jonkerz added the script label Jan 17, 2020
@jonkerz
Copy link
Member Author

jonkerz commented Jan 17, 2020

EDIT_SUMMARY = "Set fossil flag for non-fossil taxa with fossil protonyms, see %github846"
jonkerz = User.find(60)
Activity.execute_script_activity jonkerz, EDIT_SUMMARY

# For PaperTrail
def antcat_bot
  @antcat_bot ||= User.find(62)
end
PaperTrail.request.whodunnit = antcat_bot.id

# NonFossilTaxaWithFossilProtonyms
soon_fossil_taxa = Taxon.extant.joins(:protonym).where(protonyms: { fossil: true }).includes(:protonym)
soon_fossil_taxa.each do |taxon|
  taxon.update!(fossil: true)
  taxon.create_activity :update, antcat_bot, edit_summary: EDIT_SUMMARY
end

@jonkerz jonkerz added this to the 3.2.24 milestone Jan 18, 2020
@jonkerz jonkerz closed this as completed Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant