I'm doing a validation that has to be longer than 4 hours and I do not know how to do it.
I have two attributes hora_inicio
and hora_final
, which belong to Time
.
In the first validation:
def validar_horas
if hora_inicio < hora_final
else
errors.add(:hora_final,"La hora final de la reunion debe ser mayor a la de hora inicial")
end
end
The second not I know how it's done, I've tried to do everything.