I need to do a HTTP call for getting the credentials of the actual DB to use. So I've added code to get the credentials and updating the active record connection in an initializer file but whenever I start rails server it is looking for development in database.yml. how to escape this?
Asked
Active
Viewed 222 times
1
-
add the value in database.yml as env value, `ENV["fetched value"]` – buncis Mar 25 '19 at 07:29
-
1are you saying I update ENV value with the result of the external request and feed that ENV value to database.yml? – C LOKESH REDDY Mar 25 '19 at 07:38
-
yes you are correct – buncis Mar 25 '19 at 07:40
-
Checkout https://mavens.github.io/2016/02/09/rails-multi-db to get some idea – Amit Patel Mar 25 '19 at 11:19