this won't work with Rails >= 4.2