12345678910111213141516171819202122232425262728 |
- User.delete_all
- User.reset_pk_sequence
- Activity.delete_all
- Activity.reset_pk_sequence
- JoinedUserActivity.delete_all
- JoinedUserActivity.reset_pk_sequence
-
- 10.times do |i|
- name = Faker::Name.first_name.downcase
- user = User.create! username: "#{name}", email: "#{name}@email.com", password: "azerty"
- puts "Created USER ##{i} - #{user.username}"
-
- 2.times do
- activity = Activity.create!(
- name: Faker::Science.element,
- client: Faker::Company.name,
- description: Faker::Company.catch_phrase,
- author_id: user.id
- )
- puts "Created ACTIVITY \"#{activity.name}\" for #{activity.client}"
-
- joined_user_activity = JoinedUserActivity.create!(
- user_id: user.id,
- activity_id: activity.id
- )
- puts "Created ASSOCIATION ##{joined_user_activity.id}"
- end
- end
|