From 9e5a99f3b457ca0a4b88ae6ce5906ba7e5c77b69 Mon Sep 17 00:00:00 2001 From: Wei Xie Date: Fri, 23 Jul 2010 21:07:09 +0800 Subject: import User data from db:seed --- db/seeds.rb | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 3174d0c..5882a4b 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,7 +1,33 @@ -# 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). -# -# Examples: -# -# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) -# Major.create(:name => 'Daley', :city => cities.first) +# rake db:seed +puts "adding users..." +users = User.create([ + { :name => 'admin', + :email_address => 'admin@g.cn', + :role => 'admin', + :password => 'admin', + :password_confirmation => 'admin'}, + + { :name => 'council member', + :email_address => 'council_member@g.cn', + :role => 'council_member', + :password => 'council_member', + :password_confirmation => 'council_member'}, + + { :name => 'council member 2', + :email_address => 'council_member2@g.cn', + :role => 'council_member', + :password => 'council_member2', + :password_confirmation => 'council_member2'}, + + { :name => 'guest', + :email_address => 'guest@g.cn', + :role => 'guest', + :password => 'guest', + :password_confirmation => 'guest'}, + + { :name => 'developer', + :email_address => 'developer@g.cn', + :role => 'developer', + :password => 'developer', + :password_confirmation => 'developer'} +]) -- cgit v1.2.3-65-gdbad