Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create seeds #41

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading