Skip to content
Snippets Groups Projects
Commit 3197178d authored by pabois's avatar pabois
Browse files

fix

parent 62b1980c
No related branches found
No related tags found
No related merge requests found
......@@ -14,12 +14,11 @@ class SetAboutFromMenuItemKind < ActiveRecord::Migration[7.0]
'62' => Communication::Website::Page::ResearchPaper
}
websites = Communication::Website.where(id: Communication::Website::Menu::Item.where(kind: mapping.keys).distinct.pluck(:website_id))
Communication::Website::Menu::Item.includes(:website).where(kind: mapping.keys.map(&:to_i)).find_each do |menu_item|
kinds = mapping.keys.map(&:to_i)
Communication::Website::Menu::Item.includes(:website).where(kind: kinds).find_each do |menu_item|
page_class = mapping[menu_item.kind_before_type_cast.to_s]
about = menu_item.website.special_page(page_class)
menu_item.update(about: about, kind: :page)
end
websites.find_each(&:sync_with_git)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment