以Heroku方式实现环境

时间:2014-12-23 09:33:30

标签: ruby-on-rails ruby ruby-on-rails-4 heroku

Heroku advices against使用默认的Rails'创建自定义环境的方法:config/environments/staging.rb

相反,他们建议使用their config vars

我是否正确理解,以确定在哪个"环境"代码在我将设置如下变量:

heroku config:set CUSTOM_ENV=staging --remote my_staging_app
heroku config:set CUSTOM_ENV=production --remote my_production_app

然后在我的代码中:

send_real_mail if ENV['CUSTOM_ENV'] == "production"

0 个答案:

没有答案