From 67530f536964a047aab336fa2b612190b3d78a7c Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Mon, 2 Jan 2023 14:15:15 +0100 Subject: [PATCH] complexity --- app/services/blocks_migration.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/services/blocks_migration.rb b/app/services/blocks_migration.rb index 7691d9ac8..61c440de4 100644 --- a/app/services/blocks_migration.rb +++ b/app/services/blocks_migration.rb @@ -5,11 +5,9 @@ class BlocksMigration def self.cleanup Communication::Website::Post.find_each do |post| - next if post.text.blank? cleanup_item post end Communication::Website::Page.find_each do |page| - next if page.text.blank? cleanup_item page end end @@ -17,6 +15,7 @@ class BlocksMigration private def self.cleanup_item(item) + return if item.text.blank? puts "#{item} (#{item.id}, #{item.university}, #{item.website})" return if item.blocks.any? puts " migrating" -- GitLab