tapangi/rgmanager — pull request #24 by karlhigley (2013-02-27 02:27:33+00:00)
Title: Added rake tasks to easily switch development databases

### Re: the recent database configuration commits:

There are plenty of valid reasons to test the application locally with a test environment similar to the server's environment, and it's certainly a good idea to run the tests on Postgres before merging pull requests or deploying.

At the same time, some potential contributors have given up before getting the application to run successfully on their local machines. At yesterday's RailsGirls meetup, I was asked to help three people set up a Postgres development database for this application. Even with the new directions, none of them was successful, for a variety reasons having to do with the peculiarities of their local machines' configurations.

This commit is a suggestion about how to balance those two concerns. In order to make it easy for newbie contributors to get started quickly, while also making it easy for more advanced developers to use Postgres, this commit changes the following:

* Adds two new database configuration files, database.postgres.yml and database.sqlite.yml, in order to maintain both Postgres and SQLite configuration options in the repository
* Adds two rake tasks that copy one or the other of the configurations above into database.yml (db:select:postgres and db:select:sqlite)
* Adds sqlite3 to the development and test groups in the Gemfile, so that it is available for development and testing (but not in production)
* Makes SQLite the default development and test database
* Adds database.yml to the .gitignore file, so that contributors' database selections don't get committed and affect others

Note what this would imply about the social structure of the project: people who are merging pull requests should be using Postgres and running the tests on the proposed changes before merging.