refactor Rails version comparisons