Revert "Removed more legacy Rails 2 code"

This reverts commit 648a0da665a3fbfa1012fa7949fb43b379d8743d.