Fix activerecord database connection