add conditional to pass rails 4.0