Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to store app specific configuration in rails?

I need to store app specific configuration in rails. But it has to be:

  • reachable in any file (model, view, helpers and controllers
  • environment specified (or not), that means each environment can overwrite the configs specified in environment.rb

I've tried to use environment.rb and put something like

USE_USER_APP = true

that worked to me but when trying to overwrite it in a specific environment it wont work because production.rb, for instance, seems to be inside the Rails:Initializer.run block.

So, anyone?

like image 252
Ricardo Acras Avatar asked Sep 21 '08 02:09

Ricardo Acras


1 Answers

Look at Configatron: http://github.com/markbates/configatron/tree/master

I have yet to use it, but he's actively developing it now, and looks quite nice.

like image 164
Bill Turner Avatar answered Oct 30 '22 11:10

Bill Turner