mercredi 22 mai 2019

How to seed multiple items within same column?

I am trying to seed multiples items into the same column, i.e. 1 user with 5 products, but doesn't seem to work, I was wondering how do I do it? codes below


User.create!([{
  name: "Ant-Man",
  email: "1234@gmail.com",
  product: "mac","piano","paper","book",
  password: "123456",
},
{
  name: "Joe",
  email: "joe@gmail.com",
  product: "macboook",
  password: "123456",
},
{
  name: "Alice",
  email: "123@gmail.com",
  product: "mascara",
  password: "123456",
},
{
  name: "Amy",
  email: "amy@gmail.com",
  product: "travelling book",
  password: "123456",
},
{
  name: "James",
  email: "James@gmail.com",
  product: "pen",
  password: "123456",
},
{
  name: "Edward",
  email: "edward@gmail.com",
  product: "piano",
  password: "123456",
},])

Aucun commentaire:

Enregistrer un commentaire