Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to use postgresql and avoid testunit by default in rails 3.2?

I'm tired of typing $ rails new [app name] -d postgresql --skip-test-unit every time I start a new rails app. I'm using rails 3.2.

Is there any way to make using postresql and skipping test unit my default for new rails apps?

like image 320
BenU Avatar asked Aug 19 '12 15:08

BenU


1 Answers

Yes. Rails 3.2 makes setting those defaults easy by updating your ~/.railsrc file.

At the command line:

$ echo -d postgresql -T > ~/.railsrc

Now every new rails app will use postgresql and avoid testunit.

$ rails new [my new app]
[my computer]:[my directory] [my name]$ rails new [my new app]
Using -d postgresql -T from /Users/benjaminunger/.railsrc
  create  
  create  README.rdoc
  create  Rakefile
.
.
.

Any flag for the rails new generator can become a default by updating the ~/.railsrc file.

like image 125
BenU Avatar answered Oct 18 '22 16:10

BenU