You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
1.9 KiB
77 lines
1.9 KiB
# 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 rails db:seed command (or created alongside the database with db:setup).
|
|
#
|
|
# Examples:
|
|
#
|
|
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
|
# Character.create(name: 'Luke', movie: movies.first)
|
|
|
|
# 创建匿名用户
|
|
user_params = [
|
|
{
|
|
id: 1,
|
|
login: 'educoder',
|
|
hashed_password: '6763c9a6d5c201903feed5950a2c4459cef8d3ec',
|
|
lastname: '指导老师',
|
|
mail: '721773699@qq.com',
|
|
admin: 1,
|
|
status: 1,
|
|
type: 'User',
|
|
language: 'zh',
|
|
nickname: 'Educoder',
|
|
show_realname: '指导老师',
|
|
professional_certification: 1,
|
|
certification: 1,
|
|
salt: '3dce3e3983227c40c48a25419d41de7e',
|
|
profile_completed: 1
|
|
},
|
|
{
|
|
id: 2,
|
|
hashed_password: 'aaacd2fdabaaa3a54c4ada625a2611b5f0ffa437',
|
|
status: 3,
|
|
type: 'AnonymousUser',
|
|
salt: '96a9104963f8f2f9d35f1f384f8e8bf7'
|
|
}
|
|
]
|
|
user_extension_params = [
|
|
{
|
|
id: 1,
|
|
user_id: 1,
|
|
gender: 0,
|
|
location: "山东",
|
|
occupation: "海军航空大学",
|
|
technical_title: "副教授",
|
|
identity: 0,
|
|
location_city: "烟台",
|
|
school_id: 1,
|
|
department_id: 1
|
|
},
|
|
{
|
|
id: 2,
|
|
user_id: 2,
|
|
gender: 1,
|
|
identity: 1
|
|
}
|
|
]
|
|
school_params = {
|
|
id: 1,
|
|
name: "海军航空大学",
|
|
province: "山东",
|
|
pinyin: 'zhongguoyidongtongxinjiduan',
|
|
school_type: 0,
|
|
city: "烟台",
|
|
address: "二马路",
|
|
auto_users_trial: 1,
|
|
identifier: 'nudt'
|
|
}
|
|
department_params = {
|
|
id: 1,
|
|
name: '航空基础学院',
|
|
school_id: 1,
|
|
is_auth: 1
|
|
}
|
|
|
|
User.create!(user_params)
|
|
UserExtension.create!(user_extension_params)
|
|
School.create!(school_params)
|
|
Department.create!(department_params) |