API de comptabilité horaire.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

seeds.rb 804B

12345678910111213141516171819202122232425262728
  1. User.delete_all
  2. User.reset_pk_sequence
  3. Activity.delete_all
  4. Activity.reset_pk_sequence
  5. JoinedUserActivity.delete_all
  6. JoinedUserActivity.reset_pk_sequence
  7. 10.times do |i|
  8. name = Faker::Name.first_name.downcase
  9. user = User.create! username: "#{name}", email: "#{name}@email.com", password: "azerty"
  10. puts "Created USER ##{i} - #{user.username}"
  11. 2.times do
  12. activity = Activity.create!(
  13. name: Faker::Science.element,
  14. client: Faker::Company.name,
  15. description: Faker::Company.catch_phrase,
  16. author_id: user.id
  17. )
  18. puts "Created ACTIVITY \"#{activity.name}\" for #{activity.client}"
  19. joined_user_activity = JoinedUserActivity.create!(
  20. user_id: user.id,
  21. activity_id: activity.id
  22. )
  23. puts "Created ASSOCIATION ##{joined_user_activity.id}"
  24. end
  25. end