I have the following code:
我有以下代码:
list_entities = [{:phone => '0000000000', :name => 'Test', :"@i:type => '1'},{:phone => '1111111111', :name => 'Demo', :"@i:type => '1'}]
list_entities.each do |list_entity|
phone_contact = PhoneContact.create(list_entity.except(:"@i:type"))
add_record_response = api.add_record_to_list(phone_contact, "API Test")
if add_record_response[:add_record_to_list_response][:return][:list_records_inserted] != '0'
phone_contact.update(:loaded_at => Time.now)
end
end
list_ent