Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated seedfile with cars #1

Merged
merged 1 commit into from
May 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,26 @@
# Character.create(name: "Luke", movie: movies.first)

User.destroy_all
Car.destroy_all

puts 'Creating 10 test users.'
usernumber = 1
10.times do
user = User.create!(
email: "user#{usernumber}@test.com",
password: "123456",
first_name: "Name#{usernumber}",
last_name: "Name"
)
usernumber += 1
end
puts 'Creating 4 test users.'
user1 = User.create!(first_name: 'Bruce', last_name: 'Wayne', email: '[email protected]', password: '123456')
user2 = User.create!(first_name: 'John', last_name: 'Doe', email: '[email protected]', password: '123456')
user3 = User.create!(first_name: 'Jane', last_name: 'Doe', email: '[email protected]', password: '123456')
user4 = User.create!(first_name: 'Sarah', last_name: 'Connor', email: '[email protected]', password: '123456')

puts 'adding cars to user'
Car.create!(brand: 'Mercedes', model: '', year: 'Mon, 29 May 2023', description: '', user: user1)
Car.create!(brand: 'Lexus', model: '', year: 'Mon, 29 May 2023', description: '', user: user2)

# usernumber = 1
# 10.times do
# user = User.create!(
# email: "user#{usernumber}@test.com",
# password: "123456",
# first_name: "Name#{usernumber}",
# last_name: "Name"
# )
# usernumber += 1
# end
puts 'Finished!'