Commit 29ccb9276cec52b123cc9d1b6db51e65acd681a3

Authored by LeandroNunes
1 parent 6d47fd83

ActionItem19: adding populate script and refactoring reset_db

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@308 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 2 changed files with 12 additions and 6 deletions   Show diff stats
script/populate 0 → 100755
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +#!/usr/bin/env ruby
  2 +require File.dirname(__FILE__) + '/../config/environment'
  3 +
  4 +User.create!(:login => 'test', :email => 'admin@example.com', :password => 'test', :password_confirmation => 'test')
  5 +User.create!(:login => 'user', :email => 'user@example.com', :password => 'user', :password_confirmation => 'user')
  6 +User.create!(:login => 'usuario', :email => 'usuario@example.com', :password => 'usuario', :password_confirmation => 'usuario')
script/reset_db
1 -#!/bin/sh 1 +#!/usr/bin/env ruby
  2 +require File.dirname(__FILE__) + '/../config/environment'
2 3
3 -rm tmp/*.db  
4 -  
5 -rake db:migrate VERSION=0 &&  
6 -rake db:migrate &&  
7 -rake db:fixtures:load 4 +system "rm #{RAILS_ROOT}/tmp/*.db"
  5 +system "rake db:migrate VERSION=0"
  6 +system "rake db:migrate"
  7 +system "ruby #{RAILS_ROOT}/script/populate"