3

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

asked Mar 29, 2012 at 12:26

3 Answers 3

2

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.

answered Mar 29, 2012 at 13:11
1
  • 3
    BTW: Rails actually preprocesses database.yml with ERb, so you can put any Ruby you want in there :-) Commented Mar 29, 2012 at 14:59
1

One bonus is that other languages can read YAML, while you can't read a ruby config file in Python (easily).

That said I'd use ruby for complex config setups

answered Jun 17, 2012 at 13:41
0

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.

answered Mar 29, 2012 at 15:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.