<commit_before># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)

unless User.find_by(email: '<EMAIL>')

  User.create(
    :first_name => 'Jane',
    :last_name => 'Doe',
    :address => '100 Fake St',
    :zip_code => '11216',
    :email => '<EMAIL>',
    :password => '<PASSWORD>',
    :apartment => '4C',
    :phone_number => '333-333-3333'
  )

  User.create(
    :first_name => 'John',
    :last_name => 'Doe',
    :address => '100 Fake St',
    :zip_code => '11216',
    :apartment => '4D',
    :email => '<EMAIL>',
    :password => '<PASSWORD>',
    :phone_number => '333-343-3333'
  )

  User.create(
      :first_name => 'Jamie',
      :last_name => 'Dough',
      :address => '800 S Notreal Ave',
      :zip_code => '11238',
      :email => '<EMAIL>',
      :apartment => '6E',
      :password => '<PASSWORD>'
  )

  User.create(
      :first_name => 'Jake',
      :last_name => 'Deaux',
      :address => '200 Doesntexist Ln',
      :zip_code => '10451',
      :email => '<EMAIL>',
      :password => '<PASSWORD>'
  )

  User.create(
    :first_name => 'June',
    :last_name => "D'oh",
    :address => '200 Doesntexist Ln',
    :zip_code => '10451',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )

  User.create(
    :first_name => '<NAME>',
    :last_name => 'Account',
    :address => '101 Fake Ave',
    :zip_code => '10474',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )

  User.create(
    :first_name => '<NAME>',
    :last_name => 'Account',
    :address => '300 Madeup St',
    :zip_code => '10005',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )
 
  User.create(
    :first_name => '<NAME>',
    :last_name => 'Account',
    :address => '439 Bogus Lane',
    :zip_code => '10128',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )

  User.create(
    :first_name => 'Team',
    :last_name => 'Member',
    :address => '100 Fake St',
    :zip_code => '10004',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )

  User.create(
      :first_name => 'Super',
      :last_name => 'User',
      :address => '100 Fake St',
      :zip_code => '10004',
      :email => '<EMAIL>',
      :password => '<PASSWORD>'
  )
end


jane = User.find_by(email: '<EMAIL>')
john = User.find_by(email: '<EMAIL>')
jamie = User.find_by(email: '<EMAIL>')
jake = User.find_by(email: '<EMAIL>')
demo = User.find_by(email: '<EMAIL>')
live = User.find_by(email: '<EMAIL>')
june = User.find_by(email: '<EMAIL>')
users = [jane, john, jake, demo, live]

lawyer = User.find_by(email: '<EMAIL>')
lawyer.permissions = 50
lawyer.collaborators = [june]
lawyer.save

team_member = User.find_by(email: '<EMAIL>')
team_member.permissions = 10
team_member.collaborators = users + [jamie]
team_member.save

super_user = User.find_by(email: '<EMAIL>')
super_user.permissions = 0
super_user.collaborators = users + [jamie]
super_user.save

now = Time.now
users << june
users.each do |user|
  current_time = now - (now.to_i % 3600)
  user.readings.clear
  current_temp = 68
  current_outdoor_temp = 45
  200.times do |count|
    current_time -= 3600
    if user.during_the_day?(current_time)
      current_temp += rand(-3..2)
      current_outdoor_temp += rand(-1..3)
    else
      current_temp += rand(-2..3)
      current_outdoor_temp += rand(-1..3)
    end

    current_temp -= 2 if current_temp > 68
    current_temp += 2 if current_temp < 52
    current_outdoor_temp -= 2 if current_outdoor_temp > 55
    current_outdoor_temp += 2 if current_outdoor_temp < 25

    if user == demo
      Reading.create(created_at: current_time, temp: 68, outdoor_temp: current_outdoor_temp, user: user)
    elsif user == jane && 100 < count && count < 124
      next
    else
      Reading.create(created_at: current_time, temp: current_temp, outdoor_temp: current_outdoor_temp, user: user)
    end
  end
end

Reading.create(temp: 115, outdoor_temp: 37, user: jake, twine: jake.twine)<commit_msg>Add query-able addresses to seed file<commit_after># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)

unless User.find_by(email: '<EMAIL>')

  User.create(
    :first_name => 'Jane',
    :last_name => 'Doe',
    :address => '625 6th Ave',
    :zip_code => '10011',
    :email => '<EMAIL>',
    :password => '<PASSWORD>',
    :apartment => '4C',
    :phone_number => '333-333-3333'
  )

  User.create(
    :first_name => 'John',
    :last_name => 'Doe',
    :address => '625 6th Ave',
    :zip_code => '10011',
    :apartment => '4D',
    :email => '<EMAIL>',
    :password => '<PASSWORD>',
    :phone_number => '333-343-3333'
  )

  User.create(
      :first_name => 'Jamie',
      :last_name => 'Dough',
      :address => '636 6th Ave',
      :zip_code => '10011',
      :email => '<EMAIL>',
      :apartment => '6E',
      :password => '<PASSWORD>'
  )

  User.create(
      :first_name => 'Jake',
      :last_name => 'Deaux',
      :address => '636 6th Ave',
      :zip_code => '10011',
      :email => '<EMAIL>',
      :password => '<PASSWORD>'
  )

  User.create(
    :first_name => 'June',
    :last_name => "D'oh",
    :address => '200 Doesntexist Ln',
    :zip_code => '10451',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )

  User.create(
    :first_name => '<NAME>',
    :last_name => 'Account',
    :address => '101 Fake Ave',
    :zip_code => '10474',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )

  User.create(
    :first_name => '<NAME>',
    :last_name => 'Account',
    :address => '300 Madeup St',
    :zip_code => '10005',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )
 
  User.create(
    :first_name => '<NAME>',
    :last_name => 'Account',
    :address => '439 Bogus Lane',
    :zip_code => '10128',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )

  User.create(
    :first_name => 'Team',
    :last_name => 'Member',
    :address => '100 Fake St',
    :zip_code => '10004',
    :email => '<EMAIL>',
    :password => '<PASSWORD>'
  )

  User.create(
      :first_name => 'Super',
      :last_name => 'User',
      :address => '100 Fake St',
      :zip_code => '10004',
      :email => '<EMAIL>',
      :password => '<PASSWORD>'
  )
end


jane = User.find_by(email: '<EMAIL>')
john = User.find_by(email: '<EMAIL>')
jamie = User.find_by(email: '<EMAIL>')
jake = User.find_by(email: '<EMAIL>')
demo = User.find_by(email: '<EMAIL>')
live = User.find_by(email: '<EMAIL>')
june = User.find_by(email: '<EMAIL>')
users = [jane, john, jake, demo, live]

lawyer = User.find_by(email: '<EMAIL>')
lawyer.permissions = 50
lawyer.collaborators = [june]
lawyer.save

team_member = User.find_by(email: '<EMAIL>')
team_member.permissions = 10
team_member.collaborators = users + [jamie]
team_member.save

super_user = User.find_by(email: '<EMAIL>')
super_user.permissions = 0
super_user.collaborators = users + [jamie]
super_user.save

now = Time.now
users << june
users.each do |user|
  current_time = now - (now.to_i % 3600)
  user.readings.clear
  current_temp = 68
  current_outdoor_temp = 45
  200.times do |count|
    current_time -= 3600
    if user.during_the_day?(current_time)
      current_temp += rand(-3..2)
      current_outdoor_temp += rand(-1..3)
    else
      current_temp += rand(-2..3)
      current_outdoor_temp += rand(-1..3)
    end

    current_temp -= 2 if current_temp > 68
    current_temp += 2 if current_temp < 52
    current_outdoor_temp -= 2 if current_outdoor_temp > 55
    current_outdoor_temp += 2 if current_outdoor_temp < 25

    if user == demo
      Reading.create(created_at: current_time, temp: 68, outdoor_temp: current_outdoor_temp, user: user)
    elsif user == jane && 100 < count && count < 124
      next
    else
      Reading.create(created_at: current_time, temp: current_temp, outdoor_temp: current_outdoor_temp, user: user)
    end
  end
end

Reading.create(temp: 115, outdoor_temp: 37, user: jake, twine: jake.twine)
{'fraction_non_alphanumeric': 0.1755072979708081, 'fraction_numerical': 0.03749851667259998, 'mean_word_length': 3.1354268891069674, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 205, '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': '1241305', 'n_tokens_mistral': 3302, 'n_tokens_neox': 3063, 'n_words': 715}