TheeGrassHopper said over 2 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.status = Status.all.sample
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.