2012-08-29 13:21:56 +00:00
|
|
|
# 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)
|
2013-01-04 16:18:07 +00:00
|
|
|
|
|
|
|
|
Constants::ADMIN_USER_EMAILS.each do |admin_email|
|
|
|
|
|
if AdminUser.find_by_email(admin_email).nil?
|
|
|
|
|
if 'production' == Rails.env
|
|
|
|
|
pw = Utils::random_password(16)
|
|
|
|
|
else
|
|
|
|
|
pw = 'jam123'
|
|
|
|
|
end
|
|
|
|
|
AdminUser.create!(:email => admin_email,
|
|
|
|
|
:password => pw,
|
|
|
|
|
:password_confirmation => pw)
|
|
|
|
|
end
|
|
|
|
|
end
|
2013-01-04 18:05:05 +00:00
|
|
|
|
2013-01-06 02:51:46 +00:00
|
|
|
AdminUser::sync_users
|