Skip to content

Instantly share code, notes, and snippets.

@marcometz
Last active May 20, 2021 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcometz/a0219aec88e3e0a9fe0a1068d0846ad5 to your computer and use it in GitHub Desktop.
Save marcometz/a0219aec88e3e0a9fe0a1068d0846ad5 to your computer and use it in GitHub Desktop.
use metropolis - city articles
parent_article = Goldencobra::Article.create!(url_name: "cities", breadcrumb: "cities", title: "cities", article_type: "City Index")
inactive_cities = City.where(article_id: nil)
inactive_cities.each do |city|
city_article = Goldencobra::Article.new(teaser: city.title, content: "", breadcrumb: city.title, title: city.title, article_type: "City Show", parent_id: parent_article.id)
city_article.city = city
city_article.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment