Sprankelprachtig aan/afmeldsysteem

seeds.rb 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # This file should contain all the record creation needed to seed the database with its default values.
  2. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
  3. #
  4. # Examples:
  5. #
  6. # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
  7. # Character.create(name: 'Luke', movie: movies.first)
  8. p = Person.create!(
  9. first_name: 'Maarten',
  10. infix: 'van den',
  11. last_name: 'Berg',
  12. birth_date: (Date.new 2016, 1, 1),
  13. email: 'maarten@maartenberg.nl.eu.org',
  14. is_admin: true
  15. )
  16. p2 = Person.create!(
  17. first_name: 'Henkie',
  18. last_name: 'Gekke',
  19. birth_date: (Date.new 2016, 1, 1),
  20. email: 'geefmijgeld@maartenberg.nl.eu.org'
  21. )
  22. u = User.create!(
  23. email: 'maarten@maartenberg.nl.eu.org',
  24. person: p,
  25. password: 'damena123',
  26. password_confirmation: 'damena123'
  27. )
  28. g = Group.create!(
  29. name: 'Teststam'
  30. )
  31. a = Activity.create!(
  32. public_name: 'Fikkie stoken ofzo',
  33. secret_name: 'Bosbrandopkomst',
  34. description: 'Een scout trekt er samen met anderen op uit',
  35. location: 'In het bos in het bos',
  36. start: 4.weeks.since,
  37. end: 4.weeks.since + 2.hours,
  38. deadline: 3.weeks.since,
  39. show_hidden: false,
  40. group: g
  41. )
  42. Member.create!(
  43. group: g,
  44. person: p,
  45. is_leader: true
  46. )
  47. Member.create!(
  48. group: g,
  49. person: p2
  50. )
  51. Participant.create!(
  52. activity: a,
  53. person: p,
  54. is_organizer: true,
  55. attending: true,
  56. notes: nil
  57. )
  58. Participant.create!(
  59. activity: a,
  60. person: p2,
  61. is_organizer: false,
  62. attending: false,
  63. notes: 'fliep floep'
  64. )