fix rails definition conditional