mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove bill_address fetching logic
This commit is contained in:
committed by
Maikel Linke
parent
d09ba16411
commit
de4d074cb3
@@ -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(' ')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user