Skip to content

Instantly share code, notes, and snippets.

@marcometz
Last active May 20, 2021 13:55
Show Gist options
  • Select an option

  • Save marcometz/a0219aec88e3e0a9fe0a1068d0846ad5 to your computer and use it in GitHub Desktop.

Select an option

Save marcometz/a0219aec88e3e0a9fe0a1068d0846ad5 to your computer and use it in GitHub Desktop.

Revisions

  1. marcometz revised this gist May 20, 2021. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions use - create missing city articles
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    parent_article = Goldencobra::Article.create!(url_name: "cities", breadcrumb: "cities", title: "cities", article_type: "City Index")

    inactive_city_ids = City.where(article_id: nil)
    inactive_cities = City.where(article_id: nil)

    inactive_city_ids.each do |city|
    city_article = Goldencobra::Article.new(teaser: "", content: "", breadcrumb: city.title, title: city.title, article_type: "City Show", parent_id: parent_article.id)
    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
  2. marcometz revised this gist May 18, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion use - create missing city articles
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    parent_article = Goldencobra::Article.create!(url_name: "cities", breadcrumb: "cities", title: "cities", article_type: "City Index")

    inactive_city_ids = City.where(article_id: nil).pluck(:id)
    inactive_city_ids = City.where(article_id: nil)

    inactive_city_ids.each do |city|
    city_article = Goldencobra::Article.new(teaser: "", content: "", breadcrumb: city.title, title: city.title, article_type: "City Show", parent_id: parent_article.id)
  3. marcometz revised this gist May 18, 2021. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions use - create missing city articles
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    parent_article = Goldencobra::Article.create!(url_name: "cities", breadcrumb: "cities", title: "cities", article_type: "City Index")
    City.all.each do |city|

    inactive_city_ids = City.where(article_id: nil).pluck(:id)

    inactive_city_ids.each do |city|
    city_article = Goldencobra::Article.new(teaser: "", content: "", breadcrumb: city.title, title: city.title, article_type: "City Show", parent_id: parent_article.id)
    city_article.city = city
    city_article.save
    end
    end
  4. marcometz created this gist Mar 29, 2021.
    6 changes: 6 additions & 0 deletions use - create missing city articles
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    parent_article = Goldencobra::Article.create!(url_name: "cities", breadcrumb: "cities", title: "cities", article_type: "City Index")
    City.all.each do |city|
    city_article = Goldencobra::Article.new(teaser: "", content: "", breadcrumb: city.title, title: city.title, article_type: "City Show", parent_id: parent_article.id)
    city_article.city = city
    city_article.save
    end