This reverts commit d62c05df, reversing changes made to e836dcbf.
The revert is made because rails is failing, and we need to add a fix there similar to the fix we made in Gitaly.