Skip to content

Commit

Permalink
added a db/seeds.rb file with a seed site and user
Browse files Browse the repository at this point in the history
you can now add a seed user by running "rake db:seed".  this will add
an admin user called 'admin' with a password of 'password'.  if you
don't want to use the defaults you can run script/console and cut and
paste the code from seeds.rb into the console, modifying whatever you
like as you go.
  • Loading branch information
ccabot committed Oct 4, 2010
1 parent e4e8ada commit 6021f85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.rdoc
Expand Up @@ -35,8 +35,10 @@ it should run on any system that runs Rails.
3. Modify <tt>database.yml</tt> to point to your database 3. Modify <tt>database.yml</tt> to point to your database
4. Run <tt>rake db:migrate</tt> to create the database schema 4. Run <tt>rake db:migrate</tt> to create the database schema
5. Run <tt>rake fixtures:load</tt> to load the test data 5. Run <tt>rake fixtures:load</tt> to load the test data
6. Run <tt>./script/server</tt> to start the development web server 6. Run <tt>rake db:seed</tt> to load a bootstrap admin user
7. Fire up your web browser and point it to http://localhost:3000 7. Run <tt>./script/server</tt> to start the development web server
8. Fire up your web browser and point it to http://localhost:3000
9. Log in as <tt>admin</tt> with a password of <tt>password</tt> and enjoy!


== Building Documentation == Building Documentation
Gradesheet is documented using the standard, built-in RDoc system. To build Gradesheet is documented using the standard, built-in RDoc system. To build
Expand Down
2 changes: 2 additions & 0 deletions db/seeds.rb
@@ -0,0 +1,2 @@
s = Site.find_or_create_by_name 'seed site'
User.find_or_create_by_login :login => 'admin', :site => s, :password => 'password', :password_confirmation => 'password', :first_name => 'seed', :last_name => 'user', :is_admin => true

0 comments on commit 6021f85

Please sign in to comment.