Reusing properties in database.yml
Recently, I ran into a useful way to store your base database properties, and override them per development environment. This approach is really useful, so I thought I would blog about it.
Here is an example config/database.yml file which implements the aforementioned approach:
login: &login adapter: mysql username: _your_username_ password: _your_password_ host: mysql.yourdomain.com socket: /var/run/mysqld/mysqld.sock development: < <: *login database: myclient_dev test: <<: *login database: myclient_test production: <<: *login host: mysql.myclient.com database: myclient
| Print article | This entry was posted by Caleb on July 3, 2009 at 3:14 pm, and is filed under Caleb, Ruby on Rails. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |
Comments are closed.