阅读背景:

需要从database.yml文件中获取用户名和密码,并在rake任务中传递给方法

来源:互联网 

Currently, I am using the pg gem in my rails rake task which is perfect for what I want to do. I create a variable pg_conn and pass in the connection details to the PGconn.connect method. I just don't want to change this rake task everytime the database usernames/ passwords change. How can I pass in the login details from my yaml file to the pg_conn command. Take a look at my code below:Currently, I am using the pg gem in my rails ra




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: