puts 'DEFAULT USERS'
user = User.find_or_create_by_email :name => ENV['ADMIN_NAME'].dup, :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
puts 'user: ' << user.name

locations = %w[ bakersfield bend chico elko fresno goldcountry hanford humbolt klamath losangeles medford mendocino ]
locations += %w[ merced modesto monterey oregoncoast redding reno roseburg sacramento slo santabarbara santamaria ]
locations += %w[ sfbay siskiyou stockton susanville ventura yubasutter ]
locations.each do |loc|
    puts "creating location for #{loc}"
    ClLocation.create({ name: loc })
end

categories = [
    { name: 'all community', abbreviation: 'ccc' },
    { name: 'all event', abbreviation: 'eee' },
    { name: 'all for sale / wanted', abbreviation: 'sss' },
    { name: 'antiques', abbreviation: 'ata' },
    { name: 'antiques - by dealer', abbreviation: 'ata' },
    { name: 'antiques - by owner', abbreviation: 'ata' },
    { name: 'appliances', abbreviation: 'ppa' },
    { name: 'appliances - by dealer', abbreviation: 'ppa' },
    { name: 'appliances - by owner', abbreviation: 'ppa' },
    { name: 'arts+crafts', abbreviation: 'ara' },
    { name: 'arts &amp; crafts - by dealer', abbreviation: 'ara' },
    { name: 'arts &amp; crafts - by owner', abbreviation: 'ara' },
    { name: 'atvs/utvs/snowmobiles', abbreviation: 'sna' },
    { name: 'atvs, utvs, snowmobiles - by dea', abbreviation: 'sna' },
    { name: 'atvs, utvs, snowmobiles - by own', abbreviation: 'sna' },
    { name: 'auto parts', abbreviation: 'pta' },
    { name: 'auto parts - by dealer', abbreviation: 'pta' },
    { name: 'auto parts - by owner', abbreviation: 'pta' },
    { name: 'baby+kids', abbreviation: 'baa' },
    { name: 'baby &amp; kid stuff - by dealer', abbreviation: 'baa' },
    { name: 'baby &amp; kid stuff - by owner', abbreviation: 'baa' },
    { name: 'barter', abbreviation: 'bar' },
    { name: 'beauty+hlth', abbreviation: 'haa' },
    { name: 'bicycles - by dealer', abbreviation: 'bia' },
    { name: 'bicycles - by owner', abbreviation: 'bia' },
    { name: 'bikes', abbreviation: 'bia' },
    { name: 'boats', abbreviation: 'boo' },
    { name: 'boats - by dealer', abbreviation: 'boo' },
    { name: 'boats - by owner', abbreviation: 'boo' },
    { name: 'books', abbreviation: 'bka' },
    { name: 'books &amp; magazines - by dealer', abbreviation: 'bka' },
    { name: 'books &amp; magazines - by owner', abbreviation: 'bka' },
    { name: 'business', abbreviation: 'bfa' },
    { name: 'business/commercial - by dealer', abbreviation: 'bfa' },
    { name: 'business/commercial - by owner', abbreviation: 'bfa' },
    { name: 'cars+trucks', abbreviation: 'cta' },
    { name: 'cars &amp; trucks - by dealer', abbreviation: 'cta' },
    { name: 'cars &amp; trucks - by owner', abbreviation: 'cta' },
    { name: 'cds / dvds / vhs - by dealer', abbreviation: 'ema' },
    { name: 'cds / dvds / vhs - by owner', abbreviation: 'ema' },
    { name: 'cds/dvd/vhs', abbreviation: 'ema' },
    { name: 'cell phones', abbreviation: 'moa' },
    { name: 'cell phones - by dealer', abbreviation: 'moa' },
    { name: 'cell phones - by owner', abbreviation: 'moa' },
    { name: 'clothes+acc', abbreviation: 'cla' },
    { name: 'clothing &amp; accessories - by deal', abbreviation: 'cla' },
    { name: 'clothing &amp; accessories - by owne', abbreviation: 'cla' },
    { name: 'collectibles', abbreviation: 'cba' },
    { name: 'collectibles - by dealer', abbreviation: 'cba' },
    { name: 'collectibles - by owner', abbreviation: 'cba' },
    { name: 'computers', abbreviation: 'sya' },
    { name: 'computers - by dealer', abbreviation: 'sya' },
    { name: 'computers - by owner', abbreviation: 'sya' },
    { name: 'electronics', abbreviation: 'ela' },
    { name: 'electronics - by dealer', abbreviation: 'ela' },
    { name: 'electronics - by owner', abbreviation: 'ela' },
    { name: 'farm+garden', abbreviation: 'gra' },
    { name: 'farm &amp; garden - by dealer', abbreviation: 'gra' },
    { name: 'farm &amp; garden - by owner', abbreviation: 'gra' },
    { name: 'for sale by dealer', abbreviation: 'sss' },
    { name: 'for sale by owner', abbreviation: 'sss' },
    { name: 'free stuff', abbreviation: 'zip' },
    { name: 'furniture', abbreviation: 'fua' },
    { name: 'furniture - by dealer', abbreviation: 'fua' },
    { name: 'furniture - by owner', abbreviation: 'fua' },
    { name: 'garage sales', abbreviation: 'gms' },
    { name: 'general', abbreviation: 'foa' },
    { name: 'general for sale - by dealer', abbreviation: 'foa' },
    { name: 'general for sale - by owner', abbreviation: 'foa' },
    { name: 'health and beauty - by dealer', abbreviation: 'haa' },
    { name: 'health and beauty - by owner', abbreviation: 'haa' },
    { name: 'heavy equipment', abbreviation: 'hva' },
    { name: 'heavy equipment - by dealer', abbreviation: 'hva' },
    { name: 'heavy equipment - by owner', abbreviation: 'hva' },
    { name: 'household', abbreviation: 'hsa' },
    { name: 'household items - by dealer', abbreviation: 'hsa' },
    { name: 'household items - by owner', abbreviation: 'hsa' },
    { name: 'jewelry', abbreviation: 'jwa' },
    { name: 'jewelry - by dealer', abbreviation: 'jwa' },
    { name: 'jewelry - by owner', abbreviation: 'jwa' },
    { name: 'materials', abbreviation: 'maa' },
    { name: 'materials - by dealer', abbreviation: 'maa' },
    { name: 'materials - by owner', abbreviation: 'maa' },
    { name: 'motorcycle parts &amp; acc', abbreviation: 'mpa' },
    { name: 'motorcycle parts/acc - by dealer', abbreviation: 'mpa' },
    { name: 'motorcycle parts/acc - by owner', abbreviation: 'mpa' },
    { name: 'motorcycles', abbreviation: 'mca' },
    { name: 'motorcycles/scooters - by dealer', abbreviation: 'mca' },
    { name: 'motorcycles/scooters - by owner', abbreviation: 'mca' },
    { name: 'musical instruments - by dealer', abbreviation: 'msa' },
    { name: 'musical instruments - by owner', abbreviation: 'msa' },
    { name: 'music instr', abbreviation: 'msa' },
    { name: 'photo+video', abbreviation: 'pha' },
    { name: 'photo/video - by dealer', abbreviation: 'pha' },
    { name: 'photo/video - by owner', abbreviation: 'pha' },
    { name: 'recreational vehicles', abbreviation: 'rva' },
    { name: 'rvs - by dealer', abbreviation: 'rva' },
    { name: 'rvs - by owner', abbreviation: 'rva' },
    { name: 'sporting', abbreviation: 'sga' },
    { name: 'sporting goods - by dealer', abbreviation: 'sga' },
    { name: 'sporting goods - by owner', abbreviation: 'sga' },
    { name: 'tickets', abbreviation: 'tia' },
    { name: 'tickets - by dealer', abbreviation: 'tia' },
    { name: 'tickets - by owner', abbreviation: 'tia' },
    { name: 'tools', abbreviation: 'tla' },
    { name: 'tools - by dealer', abbreviation: 'tla' },
    { name: 'tools - by owner', abbreviation: 'tla' },
    { name: 'toys+games', abbreviation: 'taa' },
    { name: 'toys &amp; games - by dealer', abbreviation: 'taa' },
    { name: 'toys &amp; games - by owner', abbreviation: 'taa' },
    { name: 'video gaming', abbreviation: 'vga' },
    { name: 'video gaming - by dealer', abbreviation: 'vga' },
    { name: 'video gaming - by owner', abbreviation: 'vga' },
    { name: 'wanted', abbreviation: 'waa' },
    { name: 'wanted - by dealer', abbreviation: 'waa' },
    { name: 'wanted - by owner', abbreviation: 'waa' },
    { name: 'all gigs', abbreviation: 'ggg' },
    { name: 'all housing', abbreviation: 'hhh' },
    { name: 'all jobs', abbreviation: 'jjj' },
    { name: 'all personals', abbreviation: 'ppp' },
    { name: 'all resume', abbreviation: 'res' },
    { name: 'all services offered', abbreviation: 'bbb' }
]

categories.each do |cat|
    puts "creating category #{cat}"
    Category.create(cat)
end
