<commit_before># Examples:
#
  # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
  # Mayor.create(name: 'Emanuel', city: cities.first)

NAMES = ["Chris", "Skylar", "Jennifer", "Cyrus", "John"]

GROUP_NAMES = ["Group 1", "Group 2", "Group 3", "Group 4"]

TAGS = ["health", "spiritual", "finance", "education", "personal", "relationship", "work", "political", "weight-loss"]

# def create_tags
#   TAGS.each{|tag| Tag.create(name: tag)}
# end

# create_tags

def emails
  emails = []
  base_string = "<EMAIL>"
  (1..20).each do |number|
    emails << base_string.gsub("0", number.to_s)
  end
  emails
end

EMAILS = emails

lang_goal = Goal.create(
	name: "French", 
	description: "Become conversationally proficient in French in 6 months", 
	due_date: "Thu, 15 Oct 2015".to_date, 
	motivation: "I'm traveling to France in November", 
	potential_barrier: "I don't know how I'll find the time", 
	coping_strategy: "Using Goaly!", 
	support: "My friend so-and-so is learning with me.", 
	activities: Activity.create([
		{description: "Practice Duolingo", 
			period: "day", 
			barrier: "I feel like I don't have time.", 
			facilitator: "Jennifer will always be there cheering me on!"}, 
		{description: "Have a conversation with a native speaker", 
			period: "month", 
			barrier: "I'm shy", 
			facilitator: "I'm friendly", 
			frequency: 2}, 
		{description: "Watch foreign-language TV", 
			period: "week", 
			barrier: "The weather is getting nice and I might not want to watch TV.", 
			facilitator: "???", 
			frequency: 1}, 
		{description: "Read in the langauge", 
			period: "week", 
			barrier: "", 
			facilitator: "", 
			frequency: 2}]))

exercise_goal = Goal.create(
	name: "Exercise", 
	description: "Exercise 3x/week for the next 3 months", 
	due_date: "2015-07-15T".to_date, 
	motivation: "I want to go hiking this summer", 
	potential_barrier: "I don't know how I'll find the time", 
	coping_strategy: "Using Goaly!", 
	support: "My friend so-and-so is doing this with me.", 
	activities: Activity.create([
  {description: "Do yoga", 
  	period: "week", 
  	barrier: "I feel like I don't have time.", 
  	facilitator: "Jennifer will always be there cheering me on!", 
  	frequency: 3},
  {description: "Go for a walk outside", 
  	period: "week", 
  	barrier: "It's very rainy", 
  	facilitator: "I can ask a friend to come with.", 
  	frequency: 7},
  {description: "Do strength-training in the gym", 
  	period: "week", 
  	barrier: "I don't like strength-training that much.", 
  	facilitator: "???", 
  	frequency: 4}]))

def create_users(lang_goal, exercise_goal)
  index = 0
  while index < EMAILS.length
    user = User.create(name: NAMES.sample, email: EMAILS[index], password: "<PASSWORD>", goals: [lang_goal, exercise_goal])
    index += 1
  	binding.pry
  end
end

create_users(lang_goal, exercise_goal)
<commit_msg>creates SOME seed data - creates users with goals and activities<commit_after># Examples:
#
  # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
  # Mayor.create(name: 'Emanuel', city: cities.first)

NAMES = ["Chris", "Skylar", "Jennifer", "Cyrus", "John"]

GROUP_NAMES = ["Group 1", "Group 2", "Group 3", "Group 4"]

TAGS = ["health", "spiritual", "finance", "education", "personal", "relationship", "work", "political", "weight-loss"]

# def create_tags
#   TAGS.each{|tag| Tag.create(name: tag)}
# end

# create_tags

def emails
  emails = []
  base_string = "<EMAIL>"
  (1..20).each do |number|
    emails << base_string.gsub("0", number.to_s)
  end
  emails
end

EMAILS = emails

lang_goal = Goal.create(
	name: "French", 
	description: "Become conversationally proficient in French in 6 months", 
	due_date: "Thu, 15 Oct 2015".to_date, 
	motivation: "I'm traveling to France in November", 
	potential_barrier: "I don't know how I'll find the time", 
	coping_strategy: "Using Goaly!", 
	support: "My friend so-and-so is learning with me.")

lang_activities = Activity.create([
		{description: "Practice Duolingo", 
			period: "day", 
			barrier: "I feel like I don't have time.", 
			facilitator: "Jennifer will always be there cheering me on!"}, 
		{description: "Have a conversation with a native speaker", 
			period: "month", 
			barrier: "I'm shy", 
			facilitator: "I'm friendly", 
			frequency: 2}, 
		{description: "Watch foreign-language TV", 
			period: "week", 
			barrier: "The weather is getting nice and I might not want to watch TV.", 
			facilitator: "???", 
			frequency: 1}, 
		{description: "Read in the langauge", 
			period: "week", 
			barrier: "", 
			facilitator: "", 
			frequency: 2}])

lang_goal.activities << lang_activities

exercise_goal = Goal.create(
	name: "Exercise", 
	description: "Exercise 3x/week for the next 3 months", 
	due_date: 60.days.from_now, 
	motivation: "I want to go hiking this summer", 
	potential_barrier: "I don't know how I'll find the time", 
	coping_strategy: "Using Goaly!", 
	support: "My friend so-and-so is doing this with me.")

exercise_activities = Activity.create([
  {description: "Do yoga", 
  	period: "week", 
  	barrier: "I feel like I don't have time.", 
  	facilitator: "Jennifer will always be there cheering me on!", 
  	frequency: 3},
  {description: "Go for a walk outside", 
  	period: "week", 
  	barrier: "It's very rainy", 
  	facilitator: "I can ask a friend to come with.", 
  	frequency: 7},
  {description: "Do strength-training in the gym", 
  	period: "week", 
  	barrier: "I don't like strength-training that much.", 
  	facilitator: "???", 
  	frequency: 4}])

exercise_goal.activities << exercise_activities

def create_users(lang_goal, exercise_goal)
  index = 0
  while index < EMAILS.length
    user = User.create(name: NAMES.sample, email: EMAILS[index], password: "<PASSWORD>")
    user.goals << lang_goal
    user.goals << exercise_goal
    user.save
    index += 1
  end
end

create_users(lang_goal, exercise_goal)

{'fraction_non_alphanumeric': 0.14259070871481858, 'fraction_numerical': 0.01017293997965412, 'mean_word_length': 3.887323943661972, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5340485', 'n_tokens_mistral': 2285, 'n_tokens_neox': 2011, 'n_words': 646}