Skip to content

Commit

Permalink
Create seeds (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcollie2 authored Jan 18, 2025
1 parent 11c7585 commit 2027990
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
# 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).
#
# Example:
#
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
# MovieGenre.find_or_create_by!(name: genre_name)
# end

[ "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

0 comments on commit 2027990

Please sign in to comment.