Cameron Booth
2006-Jul-28 18:47 UTC
[Rails] How to set environment specific config variables DRY-ly
Sorry, search is down on the forum, so I don''t know if this has been posted elsewhere. I have some config variables that I want to have set in all environments, and overridden in production. What I want to do is put this in my config/environment.rb SOME_CONFIG = 555 And then override it in config/environments/production.rb as: SOME_CONFIG = 333 Problem is, using constants I can''t redefine them, so it gives an error. Any suggestions for a better solution? Copying the config var to all the environments doesn''t seem very DRY. Maybe they shouldn''t be constants? Thanks in advance! Cameron -- Posted via http://www.ruby-forum.com/.
Hasan Diwan
2006-Jul-29 16:56 UTC
[Rails] How to set environment specific config variables DRY-ly
On 7/28/06, Cameron Booth <cameron@cdbdesign.net> wrote:> Problem is, using constants I can''t redefine them, so it gives an error.irb warns me. See below: irb(main):012:0> S=4 => 4 irb(main):013:0> S=3 (irb):13: warning: already initialized constant S => 3 irb(main):014:0> S => 3 And warnings aren''t fatal. -- Cheers, Hasan Diwan <hasan.diwan@gmail.com>