# 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: 'be23da3a28946db0eb0c5e62964cf7669621977a', lastname: '社区导师', mail: '721773699@qq.com', admin: 1, status: 1, type: 'User', language: 'zh', nickname: 'Educoder', show_realname: '社区导师', professional_certification: 1, certification: 1, salt: '7af297891a2a81231445b0dfb1b2eaa6', 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: 'guofangkexuejishudaxue', 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)