I'm trying to seed data into my database using rake db:seed. I get the following error TypeError: can't cast Array to string
My code
db/seeds.rb
locations_list = [
["Melbourne"],
["Sydney"],
["Canberra"],
["Newcastle"]
]
locations_list.each do |location|
Location.create(city: location)
end
universities = [
["M University"],
["T University of M"],
["R Institute of M"],
["S University of T"],
["L University"],
["D University"],
["V University"]
]
universities.each do |university|
University.create(name: university)
end
Looking through it, the syntax seems to be inorder. Can't seem to find why it's bringing up that error.
Can anyone help?