Skip to content

Commit

Permalink
added seed to populate initial data.
Browse files Browse the repository at this point in the history
  • Loading branch information
amalrik committed May 10, 2015
1 parent c04c752 commit 440d060
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Expand Up @@ -78,12 +78,11 @@ in a `config/initializers/production.rb` or similar file:
Rails.application.routes.default_url_options[:host] = Rails.application.domain

* Create an initial administrator user and at least one tag:
* Seed the database to create an initial administrator user and at least one tag:

lobsters$ rails console
Loading development environment (Rails 4.1.8)
irb(main):001:0> User.create(:username => "test", :email => "test@example.com", :password => "test", :password_confirmation => "test", :is_admin => true, :is_moderator => true)
irb(main):002:0> Tag.create(:tag => "test")
lobsters$ rake db:seed
created user: test, password: test
created tag: test

* Run the Rails server in development mode. You should be able to login to
`http://localhost:3000` with your new `test` user:
Expand Down
4 changes: 4 additions & 0 deletions db/seeds.rb
@@ -0,0 +1,4 @@
User.create(:username => "test", :email => "test@example.com", :password => "test", :password_confirmation => "test", :is_admin => true, :is_moderator => true)
puts "created user: test, password: test"
Tag.create(:tag => "test")
puts "created tag: test"

0 comments on commit 440d060

Please sign in to comment.