demarches-normaliennes/db/seeds.rb

29 lines
898 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2015-08-10 11:05:06 +02: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).
2015-08-10 11:05:06 +02:00
#
# Create an initial user who can use all roles
2015-08-10 11:05:06 +02:00
#
default_user = "test@exemple.fr"
2018-09-26 17:51:06 +02:00
default_password = "this is a very complicated password !"
puts "Create test user '#{default_user}'"
SuperAdmin.create!(email: default_user, password: default_password)
user = User.create!(
2019-08-14 15:20:08 +02:00
email: default_user,
password: default_password,
confirmed_at: Time.zone.now,
email_verified_at: Time.zone.now
2019-08-14 15:20:08 +02:00
)
user.create_instructeur!
user.create_administrateur!
2024-09-18 10:27:21 +02:00
user_fixer = User.create(email: ENV.fetch('DEFAULT_INSTRUCTEUR_EMAIL') { CONTACT_EMAIL },
password: Random.srand,
confirmed_at: Time.zone.now,
email_verified_at: Time.zone.now)
user_fixer.create_instructeur!