Most of configuration files in ruby such as Gemfile, gemspec, are just ruby code itself. Why database configuration file in rails is the exception?

link|improve this question
feedback

3 Answers

up vote 1 down vote accepted

Personal theory is ruby code is scary to administrators, and the one configuration file they would often have to mess with is the database configuration. YAML is a bit more approachable.

link|improve this answer
3  
BTW: Rails actually preprocesses database.yml with ERb, so you can put any Ruby you want in there :-) – Jörg W Mittag Mar 29 at 14:59
feedback

My guess:

For configuration of a common module across environments it is the most concise way of doing so. To do it in Ruby adds more complexity to the file.

You would have to ask the original designer though to get the real answer.

link|improve this answer
feedback

kinda like mvc and the separation of concerns.

One part is the program to read and use the values.

The other part is the values themselves in a given format.

This allow you to either change or hide either portion

It's all about common formats for data.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.