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

More on Michael Jackson…

I have loved Michael Jackson for as long as I can remember, as the following picture hopefully illustrates:

Michael and I ... back in the day

If anyone has a copy of the SEGA “Moonwalker” ROM or an actual disk, please let me know!

I take the loss of Michael Jackson to heart, it is very saddening and humbling to me that a man of such awesome talent could be so thoroughly destroyed. Michael Jackson was a prince in the black community, and a lesson for all black men that no matter how much talent one has, the powers that be in this system that has historically been so oppressive can, and perhaps will ultimately destroy you.

One of my favorite artists, Jeru said it best when he said, “The days blow by like dust, even men of steel rust”.

Apparently, Michael Jackson wasn’t doing so bad 2 days prior to his untimely death… we’ll miss you Mike!