-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathseeds.rb
17 lines (14 loc) · 932 Bytes
/
seeds.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This file should ensure the existence of records required to run the application in every environment (production,
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
[ "Global", "Africa", "Oceania", "Asia", "Latin America" ].each do |region_name|
Region.find_or_create_by!(name: region_name)
end
[ [ "sp", "sp_files" ], [ "en", "en_files" ] ].each do |language|
Language.find_or_create_by(name: language[0], file_share_folder: language[1])
end
if Rails.env.development?
User.find_or_create_by(email_address: '[email protected]', password_digest: BCrypt::Password.create('password'), is_admin: true)
User.find_or_create_by(email_address: '[email protected]', password_digest: BCrypt::Password.create('password'), is_admin: false)
end