PopulateTools / gobierto

Plataforma de gobierno abierto open source
https://gobierto.es
GNU Affero General Public License v3.0
74 stars 32 forks source link

Plans / Update SDG seeds #3224

Closed furilo closed 4 years ago

furilo commented 4 years ago

We have decided to start having the ID in the term title itself. So

"Fin de la pobreza" should become "1. Fin de la pobreza"

entantoencuanto commented 4 years ago

For existing vocabularies the terms can be updated calling from console:

vocabularies = GobiertoCommon::Vocabulary.where(slug: "sdgs-vocabulary")
vocabularies.each { |vocab| vocab.terms.where(term_id: nil).each {|t| [:es, :ca].each { |locale| t.send("name_#{locale}=", "#{t.external_id}. #{t.send("name_#{locale}")}") }; t.save } }