| 
				
			 | 
			
			
				@@ -5,18 +5,19 @@ 
			 | 
		
	
		
			
			| 
				5
			 | 
			
				5
			 | 
			
			
				 # 
			 | 
		
	
		
			
			| 
				6
			 | 
			
				6
			 | 
			
			
				 #   movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 
			 | 
		
	
		
			
			| 
				7
			 | 
			
				7
			 | 
			
			
				 #   Character.create(name: 'Luke', movie: movies.first) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				8
			 | 
			
			
				+require 'byebug' 
			 | 
		
	
		
			
			| 
				8
			 | 
			
				9
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				9
			 | 
			
				10
			 | 
			
			
				 p = Person.create!( 
			 | 
		
	
		
			
			| 
				10
			 | 
			
				11
			 | 
			
			
				   first_name: 'Maarten', 
			 | 
		
	
		
			
			| 
				11
			 | 
			
				12
			 | 
			
			
				   infix: 'van den', 
			 | 
		
	
		
			
			| 
				12
			 | 
			
				13
			 | 
			
			
				   last_name: 'Berg', 
			 | 
		
	
		
			
			| 
				13
			 | 
			
				14
			 | 
			
			
				   birth_date: (Faker::Date.between(21.years.ago, Date.today)), 
			 | 
		
	
		
			
			| 
				14
			 | 
			
				
			 | 
			
			
				-  email: 'maarten@maartenberg.nl.eu.org', 
			 | 
		
	
		
			
			| 
				
			 | 
			
				15
			 | 
			
			
				+  email: 'maarten@maartenberg.nl', 
			 | 
		
	
		
			
			| 
				15
			 | 
			
				16
			 | 
			
			
				   is_admin: true 
			 | 
		
	
		
			
			| 
				16
			 | 
			
				17
			 | 
			
			
				 ) 
			 | 
		
	
		
			
			| 
				17
			 | 
			
				18
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				18
			 | 
			
				19
			 | 
			
			
				 u = User.create!( 
			 | 
		
	
		
			
			| 
				19
			 | 
			
				
			 | 
			
			
				-  email: 'maarten@maartenberg.nl.eu.org', 
			 | 
		
	
		
			
			| 
				
			 | 
			
				20
			 | 
			
			
				+  email: 'maarten@maartenberg.nl', 
			 | 
		
	
		
			
			| 
				20
			 | 
			
				21
			 | 
			
			
				   person: p, 
			 | 
		
	
		
			
			| 
				21
			 | 
			
				22
			 | 
			
			
				   password: 'aardbei123', 
			 | 
		
	
		
			
			| 
				22
			 | 
			
				23
			 | 
			
			
				   password_confirmation: 'aardbei123' 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -26,7 +27,7 @@ p2 = Person.create!( 
			 | 
		
	
		
			
			| 
				26
			 | 
			
				27
			 | 
			
			
				   first_name: 'Henkie', 
			 | 
		
	
		
			
			| 
				27
			 | 
			
				28
			 | 
			
			
				   last_name: 'Gekke', 
			 | 
		
	
		
			
			| 
				28
			 | 
			
				29
			 | 
			
			
				   birth_date: (Faker::Date.between(21.years.ago, Date.today)), 
			 | 
		
	
		
			
			| 
				29
			 | 
			
				
			 | 
			
			
				-  email: 'gekkehenkie@maartenberg.nl.eu.org' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				30
			 | 
			
			
				+  email: 'gekkehenkie@maartenberg.nl' 
			 | 
		
	
		
			
			| 
				30
			 | 
			
				31
			 | 
			
			
				 ) 
			 | 
		
	
		
			
			| 
				31
			 | 
			
				32
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				32
			 | 
			
				33
			 | 
			
			
				 g = Group.create!( 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -45,7 +46,7 @@ end 
			 | 
		
	
		
			
			| 
				45
			 | 
			
				46
			 | 
			
			
				     first_name: (Faker::Name.first_name), 
			 | 
		
	
		
			
			| 
				46
			 | 
			
				47
			 | 
			
			
				     last_name:  (Faker::Name.last_name), 
			 | 
		
	
		
			
			| 
				47
			 | 
			
				48
			 | 
			
			
				     birth_date: (Faker::Date.between(21.years.ago, Date.today)), 
			 | 
		
	
		
			
			| 
				48
			 | 
			
				
			 | 
			
			
				-    email: "testuser#{i}@maartenberg.nl.eu.org" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				49
			 | 
			
			
				+    email: "testuser#{i}@maartenberg.nl" 
			 | 
		
	
		
			
			| 
				49
			 | 
			
				50
			 | 
			
			
				   ) 
			 | 
		
	
		
			
			| 
				50
			 | 
			
				51
			 | 
			
			
				 end 
			 | 
		
	
		
			
			| 
				51
			 | 
			
				52
			 | 
			
			
				  
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -72,9 +73,6 @@ Group.all.each do |g| 
			 | 
		
	
		
			
			| 
				72
			 | 
			
				73
			 | 
			
			
				     starttime = Faker::Time.between(DateTime.now, 1.years.since, :morning) 
			 | 
		
	
		
			
			| 
				73
			 | 
			
				74
			 | 
			
			
				     endtime   = Faker::Time.between(1.hours.since(starttime), 1.days.since(starttime), :afternoon) 
			 | 
		
	
		
			
			| 
				74
			 | 
			
				75
			 | 
			
			
				     deadline  = 5.days.ago(starttime) 
			 | 
		
	
		
			
			| 
				75
			 | 
			
				
			 | 
			
			
				-    puts starttime 
			 | 
		
	
		
			
			| 
				76
			 | 
			
				
			 | 
			
			
				-    puts endtime 
			 | 
		
	
		
			
			| 
				77
			 | 
			
				
			 | 
			
			
				-    puts deadline 
			 | 
		
	
		
			
			| 
				78
			 | 
			
				76
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				79
			 | 
			
				77
			 | 
			
			
				     act = Activity.create!( 
			 | 
		
	
		
			
			| 
				80
			 | 
			
				78
			 | 
			
			
				       public_name: Faker::Hacker.ingverb, 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -105,9 +103,12 @@ Person.all.each do |p| 
			 | 
		
	
		
			
			| 
				105
			 | 
			
				103
			 | 
			
			
				           notes = nil 
			 | 
		
	
		
			
			| 
				106
			 | 
			
				104
			 | 
			
			
				         end 
			 | 
		
	
		
			
			| 
				107
			 | 
			
				105
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				108
			 | 
			
				
			 | 
			
			
				-        part = Participant.create!( 
			 | 
		
	
		
			
			| 
				
			 | 
			
				106
			 | 
			
			
				+        # Participants are created on adding to group! 
			 | 
		
	
		
			
			| 
				
			 | 
			
				107
			 | 
			
			
				+        part = Participant.find_by( 
			 | 
		
	
		
			
			| 
				109
			 | 
			
				108
			 | 
			
			
				           activity: a, 
			 | 
		
	
		
			
			| 
				110
			 | 
			
				
			 | 
			
			
				-          person:   p, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				109
			 | 
			
			
				+          person: p 
			 | 
		
	
		
			
			| 
				
			 | 
			
				110
			 | 
			
			
				+        ) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				111
			 | 
			
			
				+        part.update!( 
			 | 
		
	
		
			
			| 
				111
			 | 
			
				112
			 | 
			
			
				           is_organizer: Faker::Boolean.boolean(0.1), 
			 | 
		
	
		
			
			| 
				112
			 | 
			
				113
			 | 
			
			
				           attending: [true, false, nil].sample, 
			 | 
		
	
		
			
			| 
				113
			 | 
			
				114
			 | 
			
			
				           notes:    notes 
			 |