TheeGrassHopper
Joined 11/25/2020
Im an aspiring Ruby developer!
TheeGrassHopper said almost 4 years ago on ActiveRecord Tricks :
db:seed doesn't populate any of my Users or my Messages? 
Status populates but not the others? hummm

TheeGrassHopper said almost 4 years ago on ActiveRecord Tricks :
20.times do
  User.create! do |user|
    user.first_name = Faker::Name.first_name
    user.last_name = Faker::Name.last_name
    user.email = Faker::Internet.email
    user.status = Status.all.sample
  end
end
When I run the above in the console I get no errors but User.all is empty then Message.create! breaks with "ActiveRecord::RecordInvalid: Validation failed: User must exist" error. It's as if it never saves the Users to the database.