I have an array of strings:
names = ['Caitlyn', 'Jayce', 'Jinx', 'Vi']
and my goal is to create several instances and once from this array:
Champion.create!([{ name: 'Caitlyn'}, { name: 'Jayce'}, { name: 'Jinx'}, { name: 'Vi']})
What would be the best way for getting from the array of strings to the array of hashes? My current approach is as follows, but knowing Ruby, there must be something better:
names.map { |name| { name: name } }