CONTACT_ADDRESS_TYPES.each do |array|
ContactAddressType.create(:description => array[0])
ContactAddressType.create(:default_item => array[1])
ContactAddressType.create(:enabled => array[2])
end
You need to use #map! instead of #each if you want to change
CONTACT_ADDRESS_TYPES in place. However, I’d think this is bad design
because you are changing the types of objects in a constant Array. I’d
rather do it differently (see below):
end
But this not working Is this the correct way to do this?Please