From de4d074cb3a07c6c744e2d6a7b9f83c743953a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Fri, 11 Feb 2022 19:10:35 +0100 Subject: [PATCH] Remove bill_address fetching logic --- db/migrate/20220105085729_split_customers_name.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/db/migrate/20220105085729_split_customers_name.rb b/db/migrate/20220105085729_split_customers_name.rb index e219869827..d6affb9a43 100644 --- a/db/migrate/20220105085729_split_customers_name.rb +++ b/db/migrate/20220105085729_split_customers_name.rb @@ -20,15 +20,6 @@ class SplitCustomersName < ActiveRecord::Migration[6.1] end def migrate_customer_name_data! - Customer.joins(:bill_address).find_each do |customer| - bill_address = customer.bill_address - - customer.update( - first_name: bill_address.firstname.to_s.strip, - last_name: bill_address.lastname.to_s.strip - ) - end - Customer.where(first_name: "", last_name: "").where.not(backup_name: [nil, ""]).find_each do |customer| name_words = customer.backup_name.split(' ')