Let's say I have an app that has the usual environments: development, staging, and production. Then let's say I have a set of tasks that I need to run in an environment where a specific set of configuration options have been overridden -- let's say the DB host -- and these scripts (and their overrides) need to run in each environment.
One solution that comes to mind is to create a whole set of environments for each of these special cases, i.e.: dboverride-development.rb, dboverride-staging, and dboverride-production. Each of these environments would inherit from its main environment, but then override the necessary configuration options. But this seems cumbersome and isn't at involves a lot of code replication.
Are there existing strategies or conventions for this use-case in rails (v4 specifically)?