I'm setting up an app for Heroku that's using the Redis Cloud addon. Redis Cloud manages sets REDISCLOUD_URL in the heroku app's config.
So I went about using ENV['REDISCLOUD_URL'] in several places in my code, but found myself wishing I could rename it. The name is misleading (we don't use Redis Cloud in development), and if I ever change providers it would be even more confusing (so I'd have to update the string in a bunch of files).
I'd love to do something like this in application.yml:
I'm setting up an app for Heroku that's using the Redis Cloud addon. Redis Cloud manages sets REDISCLOUD_URL in the heroku app's config.
So I went about using ENV['REDISCLOUD_URL'] in several places in my code, but found myself wishing I could rename it. The name is misleading (we don't use Redis Cloud in development), and if I ever change providers it would be even more confusing (so I'd have to update the string in a bunch of files).
I'd love to do something like this in application.yml:
redis_url: ENV[REDISCLOUD_URL] || "redis://localhost:6379/1"
I realize that's not valid YAML. Is there a way to do that in the figaro initializer?