Last active
May 20, 2021 13:55
-
-
Save marcometz/a0219aec88e3e0a9fe0a1068d0846ad5 to your computer and use it in GitHub Desktop.
use metropolis - city articles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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