in the migration script add state to the Contact

This commit is contained in:
Vladimir Krylov 2015-10-29 15:22:03 +02:00
parent 736aff0fc8
commit d2b5266887
3 changed files with 33 additions and 30 deletions

View file

@ -164,11 +164,11 @@ namespace :import do
zip
state
country_code
statuses
)
contacts = []
existing_contact_ids = Contact.pluck(:legacy_id)
user = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
count = 0
Legacy::Contact.includes(:object_registry, :object, object_registry: :registrar)
@ -200,7 +200,8 @@ namespace :import do
x.city.try(:strip),
x.postalcode.try(:strip),
x.stateorprovince.try(:strip),
x.country.try(:strip)
x.country.try(:strip),
[x.object_state.try(:name)|| Contact::OK]
]
if contacts.size % 10000 == 0