Skip to content
Snippets Groups Projects
Commit 50a1610d authored by Arnaud Levy's avatar Arnaud Levy
Browse files

only migrated items

parent 0afa231b
No related branches found
No related tags found
No related merge requests found
...@@ -4,10 +4,10 @@ require 'communication/block/template/chapter' ...@@ -4,10 +4,10 @@ require 'communication/block/template/chapter'
class BlocksMigration class BlocksMigration
def self.cleanup def self.cleanup
Communication::Website::Post.order(:website).find_each do |post| Communication::Website::Post.order(:website_id).find_each do |post|
cleanup_item post cleanup_item post
end end
Communication::Website::Page.order(:website).find_each do |page| Communication::Website::Page.order(:website_id).find_each do |page|
cleanup_item page cleanup_item page
end end
end end
...@@ -16,9 +16,9 @@ class BlocksMigration ...@@ -16,9 +16,9 @@ class BlocksMigration
def self.cleanup_item(item) def self.cleanup_item(item)
return if item.text.blank? return if item.text.blank?
puts "#{item.university}, #{item.website}, #{item.id}, #{item}"
return if item.blocks.any? return if item.blocks.any?
puts " migrating" puts "#{item.university}, #{item.website}, #{item.id}, #{item}"
# puts " migrating"
# puts item.text.to_html # puts item.text.to_html
return return
block = item.blocks.create university: item.university, template_kind: :chapter block = item.blocks.create university: item.university, template_kind: :chapter
......
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