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

complexity

parent 329d9254
No related branches found
No related tags found
No related merge requests found
......@@ -6,15 +6,21 @@ class BlocksMigration
def self.cleanup
Communication::Website::Post.find_each do |post|
next if post.text.blank?
puts "#{post} (#{post.id}, #{post.university})"
next if post.blocks.any?
puts " migrating"
puts post.text.to_html
# block = post.blocks.create university: post.university, template_kind: :chapter
# data = block.data
# data['text'] = post.text.to_html
# block.data = data
# block.save
cleanup_post post
end
end
private
def self.cleanup_post(post)
puts "#{post} (#{post.id}, #{post.university})"
return if post.blocks.any?
puts " migrating"
puts post.text.to_html
# block = post.blocks.create university: post.university, template_kind: :chapter
# data = block.data
# data['text'] = post.text.to_html
# block.data = data
# block.save
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