Commit Graph
6 Commits
Author SHA1 Message Date
Daniel O'Connor ca4e1961e7 Run wikidata maintenance as cropbot (#5106) 2026-10-26 23:21:51 +10:30
Daniel O'Connorandgoogle-labs-jules[bot] d3e9da077b Optimize Wikidata rake task using find_each and eager loading (#4812)
- Replace Crop.all.each with Crop.includes(:scientific_names).find_each
- Avoid per-crop N+1 queries when looking up Wikidata IDs from scientific names
- Add RSpec tests for wikidata:import_alternate_names task

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-09-20 17:27:11 +09:30
google-labs-jules[bot] 72e7b7323f feat(rake): Prioritize scientific_names.wikidata_id in task
Improves the `wikidata:import_alternate_names` Rake task to first use the `wikidata_id` from the `scientific_names` table.

- Checks for a `wikidata_id` on a crop's `scientific_names`.
- Falls back to the existing `en_wikipedia_url` if no `wikidata_id` is found.
- Adds logging to indicate the source of the Wikidata ID.
- Improves error handling.
2025-12-01 12:52:49 +00:00
google-labs-jules[bot] 87f79fb071 feat(rake): Prioritize scientific names in Wikidata task
Improves the `wikidata:import_alternate_names` Rake task to first look up a crop's Wikidata ID using its scientific names.

- Iterates through a crop's scientific names to find a Wikidata ID.
- Falls back to the existing `en_wikipedia_url` if no ID is found via scientific names.
- Adds more detailed logging to the task.
- Improves error handling by checking for non-existent Wikipedia pages and using `.dig` for safer hash access.
2025-12-01 12:44:46 +00:00
Daniel O'Connor cf8380029a Rubocop 2025-09-10 10:19:08 +00:00
google-labs-jules[bot]andDaniel O'Connor ac1463e2cf Add international alternate names for crops (#4132)
* I will add the international alternate names for the crops.

* Mark required

* Update factory

* Add placeholder

* Fix seeds

* Add language, though hardcoded to EN in most places

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-08-24 21:44:41 +09:30