Skip to content

Commit 2027990

Browse files
authored
Create seeds (#41)
1 parent 11c7585 commit 2027990

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

db/seeds.rb

+13-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
33
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
44
#
5-
# Example:
6-
#
7-
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
8-
# MovieGenre.find_or_create_by!(name: genre_name)
9-
# end
5+
6+
[ "Global", "Africa", "Oceania", "Asia", "Latin America" ].each do |region_name|
7+
Region.find_or_create_by!(name: region_name)
8+
end
9+
10+
[ [ "sp", "sp_files" ], [ "en", "en_files" ] ].each do |language|
11+
Language.find_or_create_by(name: language[0], file_share_folder: language[1])
12+
end
13+
14+
if Rails.env.development?
15+
User.find_or_create_by(email_address: '[email protected]', password_digest: BCrypt::Password.create('password'), is_admin: true)
16+
User.find_or_create_by(email_address: '[email protected]', password_digest: BCrypt::Password.create('password'), is_admin: false)
17+
end

0 commit comments

Comments
 (0)