Rails version specific logic. Ugh.