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 561B

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