Joined environment file for production and staging

Often production and staging share much, so why not use a common file for that…

#config/environments/production.rb and config/environments/staging.rb
eval(File.read("#{File.dirname(__FILE__)}/production_like.rb"))
...environment specific code ...

#config/environments/production_like.rb
config.cache_classes = true
...

the File.read/eval is rather hacky, but works nevertheless 😉

Leave a comment